TCPServerTunnel only works after initial SOCKS5 connection
ViRb3 opened this issue · 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
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.