docs: update all docs for container, cprofile, and config split

This commit is contained in:
user
2026-02-15 03:51:16 +01:00
parent a40c35cc0b
commit 20c7597ef9
7 changed files with 136 additions and 19 deletions

View File

@@ -6,11 +6,28 @@
s5p # direct, listen :1080
s5p -C socks5://127.0.0.1:9050 # through Tor
s5p -C socks5://tor:9050,http://px:8080 # Tor + HTTP proxy
s5p -c config/example.yaml # from config file
s5p -c config/s5p.yaml # from config file
s5p -l 0.0.0.0:9999 # custom listen address
s5p -t 30 # 30s per-hop timeout
s5p -v # debug logging
s5p -q # errors only
s5p --cprofile # profile to s5p.prof
s5p --cprofile out.prof # profile to custom file
```
## Container
```
make build # podman-compose build
make up # podman-compose up -d
make logs # podman-compose logs -f
make down # podman-compose down
```
## Config
```bash
cp config/example.yaml config/s5p.yaml # create live config (gitignored)
```
## Proxy URLs
@@ -29,6 +46,9 @@ http://user:pass@host:port
# Check exit IP
curl -x socks5h://127.0.0.1:1080 https://httpbin.org/ip
# Tor check
curl -x socks5h://127.0.0.1:1080 https://check.torproject.org/api/ip
# Verbose curl
curl -v -x socks5h://127.0.0.1:1080 https://example.com
@@ -36,6 +56,12 @@ curl -v -x socks5h://127.0.0.1:1080 https://example.com
curl --max-time 30 -x socks5h://127.0.0.1:1080 https://example.com
```
## Profiling
```bash
python -m pstats s5p.prof # interactive stats viewer
```
## Troubleshooting
| Symptom | Check |
@@ -44,3 +70,5 @@ curl --max-time 30 -x socks5h://127.0.0.1:1080 https://example.com
| Timeout | Increase `-t`, check proxy reachability |
| DNS leak | Use `socks5h://` (not `socks5://`) in client |
| Auth failed | Verify credentials in proxy URL |
| Port in use | `fuser -k 1080/tcp` to free the port |
| Container slow stop | Rebuild image after SIGTERM fix |

View File

@@ -5,8 +5,9 @@
- Python >= 3.11
- pip
- Tor (optional, for Tor-based chains)
- podman + podman-compose (optional, for container deployment)
## Install
## Local Install
```bash
cd ~/git/s5p
@@ -22,6 +23,24 @@ s5p --version
which s5p
```
## Symlink (alternative)
```bash
ln -sf ~/git/s5p/.venv/bin/s5p ~/.local/bin/s5p
```
## Container Install
```bash
cd ~/git/s5p
cp config/example.yaml config/s5p.yaml # edit with your proxies
make build # podman-compose build
make up # podman-compose up -d
```
The Alpine-based image (~59MB) contains only Python and PyYAML.
Application source and config are bind-mounted at runtime.
## Install Tor (optional)
```bash
@@ -31,9 +50,3 @@ sudo systemctl enable --now tor
# Verify Tor SOCKS5 port
ss -tlnp | grep 9050
```
## Symlink (alternative)
```bash
ln -sf ~/git/s5p/.venv/bin/s5p ~/.local/bin/s5p
```

View File

@@ -16,13 +16,24 @@ s5p -C socks5://127.0.0.1:9050,socks5://proxy:1080
s5p -l 0.0.0.0:9999 -C socks5://127.0.0.1:9050
# From config file
s5p -c config/example.yaml
s5p -c config/s5p.yaml
# Debug mode
s5p -v -C socks5://127.0.0.1:9050
```
## Config File
## Configuration
Copy the tracked example to create your live config:
```bash
cp config/example.yaml config/s5p.yaml
```
| File | Tracked | Purpose |
|------|---------|---------|
| `config/example.yaml` | yes | Template with placeholder addresses |
| `config/s5p.yaml` | no (gitignored) | Live config with real proxy addresses |
```yaml
listen: 127.0.0.1:1080
@@ -46,6 +57,31 @@ protocol://[username:password@]host[:port]
| socks4 | 1080 | none |
| http | 8080 | Basic |
## Container
```bash
make build # build image
make up # start container (detached)
make logs # follow logs
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.
## Profiling
```bash
# Run with cProfile enabled
s5p --cprofile -c config/s5p.yaml
# Custom output file
s5p --cprofile output.prof -c config/s5p.yaml
# Analyze after stopping
python -m pstats s5p.prof
```
## Testing the Proxy
```bash