I'm trying to forward UDP traffic over TCP using socat
. I know that frame boundaries will be lost by this process, but this is not an issue in this case. I managed to get it partially working using this command:
socat TCP-LISTEN:20000,fork UDP4-LISTEN:10000,reuseaddr
I.e., socat
waits for a client to connect to the TCP socket, then forks a new child process which listens on the UDP socket. Multiple clients should be able to connect using TCP and every client should get every received UDP message. This works as long as only a single endpoint is sending data to the UDP socket. But if a second endpoint is sending data to the UDP socket, that data will not be forwarded over an already established TCP connection.
It seems that socat
calls connect()
on the UDP socket in a forked child process as soon as it receives the first packet or otherwise filters data sent from other hosts.
Is there any way to instruct socat
to not filter UDP traffic and forward packets from any endpoint sent to the listening UDP socket?