socat as a multi-client UDP proxy on macOS?
Clash Royale CLAN TAG #URR8PPP up vote 0 down vote favorite I'm trying to use socat as a UDP proxy (v4->v6) for a client (game) which routinely initiates new UDP "connections" (TL;DR - the world runs on multiple servers listening on different UDP ports, client stays connected to 1 particular server, and will need to connect to another, as the player travels between world layers). As I understand the manual, the "fork" option should take care of this, keeping the listening socket in the parent process and forking off children bound to specific "remote" address + port: $ socat UDP4-LISTEN:11001,bind=127.0.0.1,fork,reuseport,reuseaddr UDP6-SENDTO:remotehost:11001 (repeated for port 11000) So far, so good: $ lsof -P -i 4UDP -a -p $(pgrep -d, socat) COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME socat 2990 myxal 5u IPv4 0x4e6e342add34664f 0t0 UDP localhost:11001 socat 2991 myxal 5u IPv4 0x4e6e342add345f2f 0t0 UDP localhost:11000 But when...