Socat and Binary data
I am trying to redirect connection to port 8980 to execute a telnet command to a local machine
by issuing the following command :
In Server 1 :
socat TCP-LISTEN:8980,fork EXEC:/myscript,reuseaddr
telnet 192.168.20.12 //local Server 2
I am sending Binary data from the client to Server 2 via Server 1.
so it happens that I have some characters in Hex translated to special characters in ASCII like open brackets or Commas etc.. and that closed the socket between the two machines.
Did anybody have this issue before ? if yes it there a workaround done to fix it ?
Any help is appreciated
that was the first thing that I tried before, and rinetd as well ( I m using it for other purpose ) but in this case it would not work because the client is using GSM with AT command, when the client connects with telnet, the telnet server checks what type of terminal the client is using, so in this case my GSM doesn't have an embedded terminal emulator.
So I have to go through another box using socat where the telnet server thinks that the client is the machine that runs socat which is fine.
So my solution should be some workaround on socat source code to handle those special characters as data.
or something alternative to socat.
or replace special characters before it reaches the socat with something else and that requires more coding.