erebe / wstunnel

Tunnel all your traffic over Websocket or HTTP2 - Bypass firewalls/DPI - Static binary available
Other
3.16k stars 287 forks source link

When a tunnel port is already in use the error message logged in the client grows with each connection attempt #242

Closed chibbert closed 1 month ago

chibbert commented 1 month ago

Describe the bug We've started looking to use wstunnel for our use case and love what it can do, thanks for a great project!

When creating a simple local setup to test wstunnel for our use case (reverse tunnel) I noticed that when I tested the behaviour of two clients connecting using the same tunnelling port then the INFO logs start getting longer and longer

To Reproduce Steps to reproduce the behavior:

# Start server end of wstunnel:
wstunnel server wss://[::]:8443

# Start client end of wstunnel:
wstunnel client -R tcp://[::]:9001:localhost:8001 wss://127.0.0.1:8443

# Start another client using same port 9001 of wstunnel:
wstunnel client -R tcp://[::]:9001:localhost:8002 wss://127.0.0.1:8443

# You will see the second client logs repeatedly trying to connect, but each time it fails, the error message that ends with:
.... wstunnel::tcp: Cannot connect to tcp endpoint 127.0.0.1:8443 reason Connection refused (os error 111)

grows and it looks like the details used for each connection attempt are appended to a list

Expected behavior The connection error should only show the tunnel details for the current connection attempt that just failed.

Screenshots image

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

erebe commented 1 month ago

Thanks for reporting, I am going to fix the issue.

erebe commented 1 month ago

Fixed in release 9.2.4 https://github.com/erebe/wstunnel/releases/tag/v9.2.4