this post was submitted on 30 Mar 2026
1 points (100.0% liked)
Unofficial Tor Community
236 readers
1 users here now
Link to tor project (they made the icon I grabbed, and tor itself of course): https://www.torproject.org/
This is a community to discuss the tor project and your experience with tor, tor browser, etc.
Rules are generally: be nice, don't be bigoted, etc.
Only seems fair that an infosec instance should have a community about one of the most well known anonymity tools :)
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
TL;DR: you need to make socat resilient. Try adding the fork option.
AI SLOP answer that is grounded in online search:
The behavior you're experiencing is by design: socat's
foreveroption only applies to initial connection attempts, not reconnection after a successful connection drops [^1]. Once the Tor circuit rotates (which happens every ~10 minutes by default [^5]), the underlying TCP connection dies and socat exits because its relay job is complete.Here are remedies to make your setup resilient:
1. Wrap socat in a restart loop (Recommended)
The most reliable solution is a shell wrapper that respawns socat immediately when it exits. This creates a fresh connection through a new Tor circuit:
The
reuseaddroption ensures the listening socket can be rebound immediately [^6][^7]. When Tor rotates circuits, socat dies, the loop restarts it, and irssi reconnects automatically (irssi has built-in reconnection logic [^4][^8]).2. Use
forkto handle multiple reconnectionsIf you want socat to stay alive and handle multiple sequential connections from irssi (rather than one persistent connection), add the
forkoption:This spawns child processes for each connection [^3][^6]. When a Tor circuit dies, that child exits, but the parent continues listening for irssi's reconnection attempt. However, each new connection gets a fresh SOCKS negotiation, which may use different Tor circuits for each reconnect.
3. Use a supervisor process
For a dozen IRC hosts, manage socat instances with a process supervisor:
4. Extend Tor circuit lifetime (trade-off)
You can reduce volatility by extending how long Tor keeps circuits open. In
torrc:This reduces anonymity by making your traffic patterns more linkable over time, but decreases connection drops.
Why the original approach fails
Your current command lacks
forkand uses a single process. When the SOCKS4A connection through Tor dies (circuit rotation), socat sees EOF on one address and exits—even with-s(sloppy) andignoreeof, because a dead SOCKS connection is a fatal transport error, not just an EOF [^2][^3]. Theforeveroption only helps with the initial connection attempt, not reconnection after success [^1].The restart loop approach (option 1) is the standard solution for persistent SOCKS proxying with volatile circuits—simple, predictable, and works with irssi's native reconnection handling.
[^1]: Reconnect socat connection after network failure - Stack Overflow (31%) [^2]: sockets - Socat not closing tcp connection - Super User (23%) [^3]: Ubuntu Manpage: socat - Multipurpose relay (SOcket CAT) (11%) [^4]: reconnect - Irssi dev help page (10%) [^5]: Tor traffic seems to be exiting from different Tor exit nodes (8%) [^6]: How to keep socat alive using keepalive option - Super User (6%) [^7]: SOCAT as a Polymorphic Networking Tool - Cybrary (6%) [^8]: reconnect - Irssi 1.2 help page (5%)