TCP Portforwarding, with chat

N

Neil Padgen

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.protocols.portforward but can't work out how
to go about this.

All help greatly appreciated!

-- Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top