I checked the nc(netcat)
command as pointed out in Ralu
in my comment and it works between two sockets when used with pipe :)
I used the following command:
netcat -l 5556 | netcat localhost 5557
netcat -l 5556 | netcat localhost 5557
I sent the data to port 5556 (the python client) configured by the first nc command, and made a server (small python code) listening on port 5557.
I could get data from port 5557
source share