Skip to content

Commit 8e1ed52

Browse files
committed
chor: update docs and read batch size and header checking from conf
1 parent 2b3386d commit 8e1ed52

4 files changed

Lines changed: 163 additions & 90 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ You can enable dynamic IP discovery by setting fetch_ips_from_api to true in con
183183
```json
184184
{
185185
"fetch_ips_from_api": true,
186-
"max_ips_to_scan": 100
186+
"max_ips_to_scan": 100,
187+
"scan_batch_size":100,
188+
"google_ip_validation": true // check whether ips belongs to frontend sites of google or not
187189
}
188190
```
189191

@@ -470,7 +472,9 @@ Firefox cert store خودش را جدا دارد؛ installer تلاش می‌ک
470472
```json
471473
{
472474
"fetch_ips_from_api": true,
473-
"max_ips_to_scan": 100
475+
"max_ips_to_scan": 100,
476+
"scan_batch_size":100,
477+
"google_ip_validation": true // برسی هدر های بازگشته از ایپی برای برسی هدر ها و تشخیص کاربردی بودن ایپی
474478
}
475479
```
476480

src/bin/ui.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ struct FormState {
132132
/// Whether the floating SNI editor window is open.
133133
sni_editor_open: bool,
134134
fetch_ips_from_api: bool,
135-
max_ips_to_scan: usize,
135+
max_ips_to_scan: usize,
136+
scan_batch_size:usize,
137+
google_ip_validation: bool
136138
}
137139

138140
#[derive(Clone, Debug)]
@@ -180,6 +182,8 @@ fn load_form() -> FormState {
180182
sni_editor_open: false,
181183
fetch_ips_from_api:c.fetch_ips_from_api,
182184
max_ips_to_scan:c.max_ips_to_scan,
185+
google_ip_validation: c.google_ip_validation,
186+
scan_batch_size:c.scan_batch_size
183187
}
184188
} else {
185189
FormState {
@@ -200,6 +204,8 @@ fn load_form() -> FormState {
200204
sni_editor_open: false,
201205
fetch_ips_from_api:false,
202206
max_ips_to_scan:100,
207+
google_ip_validation:true,
208+
scan_batch_size:500
203209
}
204210
}
205211
}
@@ -304,8 +310,10 @@ impl FormState {
304310
// on an empty pool.
305311
if active.is_empty() { None } else { Some(active) }
306312
},
307-
fetch_ips_from_api:false,
308-
max_ips_to_scan: 100,
313+
fetch_ips_from_api:self.fetch_ips_from_api,
314+
max_ips_to_scan: self.max_ips_to_scan,
315+
google_ip_validation:self.google_ip_validation,
316+
scan_batch_size:self.scan_batch_size
309317
})
310318
}
311319
}

src/config.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,18 @@ pub struct Config {
8585

8686
#[serde(default = "default_max_ips_to_scan")]
8787
pub max_ips_to_scan: usize,
88+
89+
#[serde(default = "default_scan_batch_size")]
90+
pub scan_batch_size:usize,
91+
92+
#[serde(default = "default_google_ip_validation")]
93+
pub google_ip_validation: bool
8894
}
8995

9096
fn default_fetch_ips_from_api() -> bool { false }
9197
fn default_max_ips_to_scan() -> usize { 100 }
92-
98+
fn default_scan_batch_size() -> usize {500}
99+
fn default_google_ip_validation() -> bool {true}
93100

94101
fn default_google_ip() -> String {
95102
"216.239.38.120".into()

0 commit comments

Comments
 (0)