I have a server that receives messages in a text-based protocol. The server doesn't send back anything. These messages eat up network bandwidth a lot since the protocol is not binary and doesn't have any compression. To fix this I want to run a compressing proxy on the client and on the server side. On the client side, the proxy should receive the data over TCP, compress it, and send to the server-side proxy. The server-side proxy should receive data, decompress it, and send to the server application.
The client-side code should be something like this:
cd /tmp
mknod backpipe p
nc localhost 7171 0<backpipe | gzip | nc server-ip 7272 | tee backpipe
And on the server side:
cd /tmp
mknod backpipe p
nc -l -p 7272 0<backpipe | gunzip | nc -l -p 7171 | tee backpipe
The server application works on 7171 port and the compressing proxy uses the 7272 port to transfer data. But this is not working for me for some reason.