nskinkel / oppy

A Tor client (onion proxy) implementation in Python
BSD 3-Clause "New" or "Revised" License
24 stars 3 forks source link

SOCKSProxy: Forwarding Behavior on Ephemeral Ports #8

Closed dwtj closed 10 years ago

dwtj commented 10 years ago

Once the SOCKS Proxy has received a SOCKS client request, it must open an ephemeral (a.k.a. dynamic) port. Let's call this port the forwarding port, since this is what will be shuffling data between the SOCKS client and the remote system. (Note that in our case, the remote system is actually on the other side of the Tor network.)

Is this new port meant to listen for exactly one connection, or can the Proxy client make multiple connections with this port?

I currently expect that the Proxy should listen to connections coming in on this ephemeral port until exactly one is made from the client that made the forwarding request. All other connections should be immediately dropped. Once the original client closes the connection to the ephemeral port, the Proxy should stop listening for connections on that port.

Strangely, specifications for both SOCKSv4 and SOCKSv5 seem to say nothing about this matter.

dwtj commented 10 years ago

If this interpretation sounds correct, then I think I know how to get to work implementing the rest of SOCKSProxy.

nskinkel commented 10 years ago

Yes, I think your interpretation is correct. It makes sense, and doing it differently seems like it would make things needlessly complex.

nskinkel commented 10 years ago

Closed after figuring stuff out at hack day today.