There is more then one way to do simple TCP proxy.

socat tcp-l:1234 tcp:1.2.3.4:1234 is "relay" or "port forwarder" (if I am right).

How to call socat tcp-l:1234 tcp-l:1235 and socat tcp:1.2.3.4:1234 tcp:1.2.3.5:1235?

(listen two sockets and relay data between them or connect two sockets and relay data between them)

link|improve this question

64% accept rate
a connection.. a TCP connection..a UDP connection. That it? I don't know about socat though. – barlop Apr 14 '11 at 14:52
It's mostly about TCP – Vi. Apr 14 '11 at 21:48
I mean, "connection" is what it's called. people talk of "TCP connection" "UDP connection" and "Connection" I don't know if there are other terms or if socat has a specific terminology though. More terminology might be that a connection can be established, or lost. – barlop Apr 15 '11 at 6:00
@barlop, 1. The question is not about connection states, it's about devices to assist connection (such as forwarder), 2. socat is just a tool to make it. It can be done without socat too. – Vi. Apr 15 '11 at 9:15
@Vi when you say forwarder, do you mean a proxy? so you're not talking about when 2 hosts connect straight to each other? – barlop Apr 16 '11 at 14:03
show 6 more comments
feedback

closed as not a real question by Oliver Salzburg, slhck, Simon Sheehan, Nifle, ChrisF Mar 8 at 22:37

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. See the FAQ for guidance on how to improve it.

3 Answers

Listening is when a socket is available and waiting for a connection.

When a relationship is established and data is being relayed, you would call that a connection.

link|improve this answer
No, it is not what I am asking. It is not about socket states or data flow, it's about connection scheme: 1. listen-connect, 2. listen-listen, 3. connect-connect. – Vi. Apr 16 '11 at 20:15
1  
@Vi In point 1, if one is listening, and not connected, how can the other end be connected. What you are writing is complete nonsense. – barlop Apr 19 '11 at 13:38
1. Listen socket. When somebody connects it, connect other socket and relay traffic. Like iptables -j DNAT. 2. Listen two sockets. Accept only one client for each. When both are accepted, relay traffic between connections. 3. Connect to two sockets and exchange data between that connections. – Vi. Apr 19 '11 at 18:37
I still can't tell what you're asking about. Sorry. – goblinbox May 23 '11 at 6:14
feedback

This reference might be helpful for some people here.

link|improve this answer
I know how to it, but don't know how to call when both sides are "listen" or both sides are "connect" – Vi. Apr 14 '11 at 21:48
feedback

I guess what you are doing could be termed "static TCP port address translation" because you are receiving traffic on a specific IP and TCP port and forwarding it to another specific IP and TCP port - but not doing it dynamically per incoming connection on that IP.

I don't think there's necessarily a super clear-cut unique term for what you're doing though.

link|improve this answer
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.