Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > TCP Portforwarding, with chat

Thread Tools

TCP Portforwarding, with chat

Neil Padgen
Posts: n/a
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

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

All help greatly appreciated!

-- Neil
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
TCP-based chat program phider1 C Programming 2 08-27-2008 10:28 PM
suggestion about chat s/w based protocol tcp or udp? islamelnaggar Java 4 01-14-2008 12:21 AM
Chat Server and Chat Client for INTRANET Java 0 01-30-2006 06:56 PM
NAT two outside TCP ports to one inside TCP port Kevin Cisco 1 11-10-2004 08:15 AM
LPR/Standard, TCP/IP, HP TCP/IP Ports DJ Chiro MCSE 1 11-07-2003 08:06 PM