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!

help connecting two netcat sockets(?) together

Status
Not open for further replies.

matt95gsr

MIS
Jul 1, 2002
60
US
I have a server that is accessable from two hosts on different networks. I'm trying to get the two hosts connected to each other through that server via self-initiated connections. In other words, I can successfully use netcat as a kind of standard proxy, where host1 connects to the netcat listener, which in turn opens a connection to host2 and proxies the data that way...something like:

nc -l -p 80 0<backpipe | tee -a inflow | nc host2 81 | tee -a outflow 1>backpipe

I have no problems with that, but what I need is for host1 and host2 to initiate connections to the server, and then be redirected to talk to each other. Here's an example of what I'm trying to accomplish:

netcat listens on ports 1111 and 2222
host1 opens connection to server:1111
host2 opens connection to server:2222
host1 and host2 can now exchange data between themselves.

No logging is necessary, and ideally, there would be no local echo to either of the hosts, just each host seeing the data sent from the remote host.

I've tried everything I can think of, but I'm not very experienced with using fifo pipes or anything, and just can't quite get where I need to be. I'd sure appreciate any ideas on this one. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top