TCP Portforwarding, with chat

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Neil Padgen

    TCP Portforwarding, with chat

    I'm trying to forward a TCP port on localhost to a TCP port on a
    remote machine, but to do that I have to go through a telnet gateway.

    This involves a little chat script:

    expect "tn-gw-> "
    send "c %s %s\n" % (remotehost, remoteport)
    expect "Connected to %s." % (remotehost)

    Next line might begin with \r\n - if so this needs stripping out.
    No output before this can be displayed to the user, but everything
    afterwards can.

    I've written a basic version using sockets, but the telnet gateway
    sends various telnet protocol characters which confuses the end
    application.

    I've tried to use twisted.protoco ls.portforward but can't work out how
    to go about this.

    All help greatly appreciated!

    -- Neil
Working...