@fanboynz/network-scanner 2.0.50 → 2.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,6 +17,7 @@ A Puppeteer-based tool for scanning websites to find third-party (or optionally
17
17
  - Subdomain handling (collapse to root or full subdomain)
18
18
  - Optionally match only first-party, third-party, or both
19
19
  - Enhanced redirect handling with JavaScript and meta refresh detection
20
+ - Per-site proxy routing (SOCKS5, SOCKS4, HTTP, HTTPS) with pre-flight health checks
20
21
 
21
22
  ---
22
23
 
@@ -315,6 +316,86 @@ Route traffic through a VPN for specific sites. Requires `sudo` privileges. The
315
316
 
316
317
  > **Authentication:** If the `.ovpn` file already contains credentials (via `auth-user-pass /path/to/file` or an inline `<auth-user-pass>` block), no additional config is needed — just provide the config path. The `username`/`password` fields are only needed when the `.ovpn` file has a bare `auth-user-pass` directive that expects interactive input.
317
318
 
319
+ ### Proxy Options
320
+
321
+ Route traffic through a proxy for specific sites. Supports SOCKS5, SOCKS4, HTTP, and HTTPS proxies. Unlike VPN, proxy routing is per-site-group — only URLs in the same config block use the proxy; other sites connect directly.
322
+
323
+ > **Note:** Chromium's `--proxy-server` flag is browser-wide. Sites requiring different proxies (or direct vs proxied) are automatically separated into different browser instances. Tasks are sorted so proxy groups are contiguous to minimise restarts.
324
+
325
+ | Field | Values | Default | Description |
326
+ |:---------------------|:-------|:-------:|:------------|
327
+ | `proxy` | String | - | Proxy URL: `socks5://host:port`, `http://host:port`, `https://host:port`, or `http://user:pass@host:port` |
328
+ | `proxy_bypass` | Array | `[]` | Domains that skip the proxy (e.g. `["localhost", "127.0.0.1", "*.local"]`) |
329
+ | `proxy_remote_dns` | Boolean | `true` | Resolve DNS through the proxy (SOCKS only — prevents DNS leaks) |
330
+ | `proxy_debug` | Boolean | `false` | Print proxy diagnostics: launch args, auth, health checks, error codes |
331
+
332
+ Legacy aliases (`socks5_proxy`, `socks5_bypass`, `socks5_remote_dns`, `socks5_debug`) are supported for backwards compatibility.
333
+
334
+ #### Proxy Examples
335
+
336
+ **SOCKS5 — no auth:**
337
+ ```json
338
+ {
339
+ "url": ["https://blocked-site.com/", "https://another-blocked.com/"],
340
+ "proxy": "socks5://127.0.0.1:1080",
341
+ "search_string": ["tracking.js"]
342
+ }
343
+ ```
344
+
345
+ **HTTP proxy with credentials:**
346
+ ```json
347
+ {
348
+ "url": ["https://geo-restricted.com/"],
349
+ "proxy": "http://user:pass@proxy.corp.com:3128",
350
+ "search_string": ["analytics"]
351
+ }
352
+ ```
353
+
354
+ **SOCKS5 with bypass list and debug:**
355
+ ```json
356
+ {
357
+ "url": ["https://target-site.com/"],
358
+ "proxy": "socks5://user:pass@proxy.example.com:9050",
359
+ "proxy_bypass": ["localhost", "127.0.0.1", "*.internal.corp"],
360
+ "proxy_remote_dns": true,
361
+ "proxy_debug": true,
362
+ "search_string": ["tracker"]
363
+ }
364
+ ```
365
+
366
+ **Mixed direct + proxied in one config:**
367
+ ```json
368
+ [
369
+ {
370
+ "url": ["https://direct-site.com/"],
371
+ "search_string": ["ads"]
372
+ },
373
+ {
374
+ "url": ["https://blocked-site.com/"],
375
+ "proxy": "socks5://127.0.0.1:1080",
376
+ "search_string": ["ads"]
377
+ }
378
+ ]
379
+ ```
380
+
381
+ #### Proxy Error Handling
382
+
383
+ If a proxy is unreachable, the batch is skipped with a clear error before any navigation is attempted:
384
+
385
+ ```
386
+ [error] [proxy] Unreachable: socks5://127.0.0.1:1080 — Connection refused
387
+ [error] [proxy] Skipping 5 URL(s) in this batch
388
+ ```
389
+
390
+ If a proxy fails mid-scan, Chromium's error code is detected and diagnosed:
391
+
392
+ ```
393
+ [error] [proxy] ERR_SOCKS_CONNECTION_FAILED — proxy: socks5://127.0.0.1:1080 — URL: https://example.com/
394
+ [error] [proxy] Check: is the proxy running? Are credentials correct? Is the target reachable from the proxy?
395
+ ```
396
+
397
+ Detected error codes: `ERR_PROXY_CONNECTION_FAILED`, `ERR_SOCKS_CONNECTION_FAILED`, `ERR_TUNNEL_CONNECTION_FAILED`, `ERR_PROXY_AUTH_UNSUPPORTED`, `ERR_PROXY_AUTH_REQUESTED`, `ERR_SOCKS_CONNECTION_HOST_UNREACHABLE`, `ERR_PROXY_CERTIFICATE_INVALID`, `ERR_NO_SUPPORTED_PROXIES`.
398
+
318
399
  ### Global Configuration Options
319
400
 
320
401
  These options go at the root level of your config.json: