Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WinSock App

Status
Not open for further replies.

excalibur78

IS-IT--Management
Jan 3, 2001
66
US
I been trying for few days now to write a program that listens on a port and anything it hears is passed to a remote ip and port. Example: Listen on port 1000 on the local ip and anything it hears is redirected to remoteip on port 80. If anyone has any help it'd be great.

Thanks

Excalibur
 
How far have you gotten? Are you using the WinSock control, or are you making calls to the WinSock API?

Chip H.
 
I'm using the winsock add-in in VB 6.0 I can listen on the local ip on any port I want but can't seem to get data to forward to a different ip and port at all.
 
Your listener application can either open a port on the redirect to IP and Port and then broker all communications through itself. Or you can send the IP and Port number back to the requesting application and have it disconnect from the listener application and reconnect on the new IP and Port it just got.

If you're using a web browswer, there is a command to tell the browswer to redirect, but I don't know what it is. Snaggs
tribesaddict@swbell.net
There are two kinds of people in life: people who like their jobs, and people who don't work here anymore.
 
What I need to do is take a telnet request on any other port besides 23 then funnel it to a different ip and port 23 on that system since the software we use binds itself to port 23 and you cannot change it and we need to run multiple copies of this app.
 
At the moment I can't think of a way to do that. Is this an application you have the source code for? If not, then there are a couple of alternative things I can think of.

1. If the program has a configuration file that determines, what the port is that it connects on, make several different config files and copy over the config file for each instance you run to make it connect to a different IP and Port.

2. See if there is a command line interface for the application. From a DOS window, type "AppName /?" without the quotes and see if it gives you parameters where you can change the IP or the port. If this is the cause launch the program from the command line.

3. As a last ditch effort, you'll be fortunate if the application uses the name of the port instead of the Port number. If this is the case, then you can modify the "Services" file for Windows that points to the Telnet port. You can do a similar thing with this file that I mentioned with the config file. Here's a clip of what this Services file looks like:
Code:
echo                7/tcp
echo                7/udp
discard             9/tcp    sink null
discard             9/udp    sink null
systat             11/tcp
systat             11/tcp    users
daytime            13/tcp
daytime            13/udp
netstat            15/tcp
qotd               17/tcp    quote
qotd               17/udp    quote
chargen            19/tcp    ttytst source
chargen            19/udp    ttytst source
ftp-data           20/tcp
ftp                21/tcp
telnet             23/tcp
smtp               25/tcp    mail
time               37/tcp    timserver
time               37/udp    timserver
You can write an application that goes in and changes the telnet port from 23/tcp to 1000/tcp or something like that. You'll have to change this file before every launch of the new instance..

Just some thoughts... Snaggs
tribesaddict@swbell.net
There are two kinds of people in life: people who like their jobs, and people who don't work here anymore.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top