docs: add proxy source API documentation
This commit is contained in:
@@ -18,6 +18,9 @@ s5p -l 0.0.0.0:9999 -C socks5://127.0.0.1:9050
|
||||
# From config file
|
||||
s5p -c config/s5p.yaml
|
||||
|
||||
# With proxy source API (rotate exit proxy per-connection)
|
||||
s5p -C socks5://127.0.0.1:9050 -S http://10.200.1.250:8081/proxies
|
||||
|
||||
# Debug mode
|
||||
s5p -v -C socks5://127.0.0.1:9050
|
||||
```
|
||||
@@ -42,7 +45,13 @@ log_level: info
|
||||
|
||||
chain:
|
||||
- socks5://127.0.0.1:9050
|
||||
- http://user:pass@proxy:8080
|
||||
|
||||
proxy_source:
|
||||
url: http://10.200.1.250:8081/proxies
|
||||
proto: socks5 # optional: filter by protocol
|
||||
country: US # optional: filter by country
|
||||
limit: 1000 # max proxies to fetch
|
||||
refresh: 300 # cache refresh interval (seconds)
|
||||
```
|
||||
|
||||
## Proxy URL Format
|
||||
@@ -69,6 +78,29 @@ make down # stop and remove container
|
||||
Source (`./src`) and config (`./config/s5p.yaml`) are mounted read-only
|
||||
into the container. Edit locally, restart to pick up changes.
|
||||
|
||||
## Proxy Source
|
||||
|
||||
Appends a random proxy from an HTTP API after the static chain on each
|
||||
connection. Proxies are cached and refreshed at a configurable interval.
|
||||
|
||||
```yaml
|
||||
proxy_source:
|
||||
url: http://10.200.1.250:8081/proxies
|
||||
proto: socks5 # optional: only fetch this protocol
|
||||
country: US # optional: only fetch this country
|
||||
limit: 1000 # max proxies to fetch from API
|
||||
refresh: 300 # re-fetch every 300 seconds
|
||||
```
|
||||
|
||||
CLI shorthand (uses defaults for limit/refresh):
|
||||
|
||||
```bash
|
||||
s5p -C socks5://127.0.0.1:9050 -S http://10.200.1.250:8081/proxies
|
||||
```
|
||||
|
||||
The API must return JSON: `{"proxies": [{"proto": "socks5", "proxy": "host:port"}, ...]}`.
|
||||
Entries with `null` proto are skipped.
|
||||
|
||||
## Profiling
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user