I need to compress telnet traffic. It’s because the link is a slow AX.25 1200 baud radio link. SSH it not an option, it's against the regulations. Anyway, compression of telnet it is.
I figured out I need to use nc (netcat) and probably named pipes (or at least one).
I guess have to use nc like this on the “server side”:
Code:
nc -lp 4001 -e <path-to-telnetd>
and
Code:
mkfifo /tmp/fifo
nc -lp 4000 < /tmp/fifo |gzip -d -c |nc localhost 4001 |gzip >/tmp/fifo
And then port 4000 would be a "gziped telnet", right?
On the client side, I did the opposite:
Code:
nc -lp 4001 < /tmp/fifo |gzip |nc <Server IP> 4000 |gzip -d -c >/tmp/fifo
And I should be able to telnet to localhost port 4001. Well, I’m missing something. It doesn't work. Perhaps there is an easier solution?
Edit: Seems to be a buffer problem. Writing to a pipe turns on full buffering. I would probably have to write my own compression software. :-(