socksy
Guides

Rotation, Sticky Sessions & the Watchdog

Grab a fresh exit IP, pin one in place, and auto-recover when a rotating exit goes bad.

Rotate the exit IP

With a rotating provider, socksy rotate re-applies the current proxy under a fresh sticky-session tag, which is how you ask for a new exit IP:

socksy rotate            # random new session tag
socksy rotate home2      # switch to a specific tag

Any existing session tag is replaced rather than stacked, and everything else about the proxy (country tag, type, credentials) is kept.

Sticky sessions (keep the same IP)

Rotating proxies hand you a new exit IP on every connection. To pin one:

socksy set --sticky 'user-country-GR:secret@host:1080'      # random session tag
socksy set --session home1 'user-country-GR:secret@host:1080'  # reuse a fixed tag

socksy appends a session tag to your username (default keyword -session-). Your provider must recognise that keyword. Check their docs and, if it differs, override it:

export SOCKSY_SESSION_KEYWORD='-sessid-'

Health watchdog

Rotating residential proxies occasionally hand you a dead exit node. Turn on the watchdog and socksy will notice and reconnect for you:

socksy watchdog on       # probe the exit every 30s; restart the relay after 2 fails
socksy watchdog status   # is it on, and what did the last check see?
socksy watchdog off

It runs as a systemd user timer, so it keeps working after logout. When the proxy is off (socksy off) the watchdog automatically stands down and resumes once you turn a proxy back on. Tune the cadence with health_interval / health_fails in the config file.

Live IP watch

socksy watch [seconds]   # live exit-IP loop (default 5s; flags every change)

On this page