Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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

    myscript contains
    telnet //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

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    The Keystone State
    Have you looked at IPTABLES and REDIRECT?


    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Thanks Lazydog,

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts