wireproxy icon indicating copy to clipboard operation
wireproxy copied to clipboard

TCPServerTunnel only works after initial SOCKS5 connection

Open ViRb3 opened this issue 3 years ago • 1 comments

Config file:

[Interface]
PrivateKey = X
Address = X

[Peer]
PublicKey = X
Endpoint = X

[TCPServerTunnel]
ListenPort = 12345
Target = localhost:12345

[Socks5]
BindAddress = 127.0.0.1:25344

I run:

./wireproxy --config config.ini

wireproxy logs: https://paste.gg/p/anonymous/7af375524bf5495f8c1fbe6c0ba9c13f

Then, I start a listener:

nc -l 12345

Now I try to connect via external (server) IP:

nc X 12345
hey

Nothing received on listener side...

But if I connect to SOCKS5 using Chrome, as soon as the first connection packet is sent, I see this:

DEBUG: 2022/06/09 01:22:22 peer(X) - Sending handshake initiation
DEBUG: 2022/06/09 01:22:22 peer(X) - Received handshake response

And now, the previous experiment works:

nc X 12345
hey
nc -l 12345
hey

ViRb3 avatar Jun 09 '22 00:06 ViRb3

It seems that wireproxy will not actually handshake with the peers until you initiate some traffic on the wireproxy side of things. If you set PersistentKeepalive on your peer, it will work without a SOCKS proxy, that seems to be enough to kick it into handshaking. I am currently trying to figure out how to force an initial handshake w/o keepalive.

jordemort avatar Aug 21 '22 15:08 jordemort