-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--connection-min-idle causes frequent WS reconnects and distupts tunnels #358
Comments
Hello, Regarding this breaking existing tunnel, it should not happen if the tunnel is already established. Only if the connection/tunnel is in pending state waiting for something to forward. Nonetheless I understand it can flood the logs. |
If an application connection is already established via the tunnel, this particular connection is maintained. However, even if there is an established and working connection within the tunnel, another connection attempt via this tunnel (at least, in case of a SOCKS tunnel) still fails under the same conditions (when made outside of the 10-seconds window). So a SOCKS tunnel remains unusable, except for "lucky" connections which make it at the right time. (With other kinds of tunnels the situation may be different; I didn't try them yet.)
Looking forward to it! |
Should be fixed in next release. You can give it a try in this pre-release https://github.com/erebe/wstunnel/releases/tag/v10.1.2-rc1 |
Made a proper release https://github.com/erebe/wstunnel/releases/tag/v10.1.2 Let me know if it is ok. |
confirmed by another user, that it is fixed |
I also confirm that running version 10.1.2 on the server side fixes this bug. Idle connections are still re-created every minute (thus polluting the logs), but it's a different story. |
Describe the bug
When I use
--connection-min-idle
,wstunnel client
tries to establish N connections each minute, which are rejected bywstunnel server
in 10 seconds withError while upgrading cnx: hyper::Error(HeaderTimeout)
. Moreover, a SOCKS tunnel I'm trying to use apparently only works if I'm connecting during this 10-seconds window.Without
--connection-min-idle
my setup works fine.To Reproduce
Set up a SOCKS tunnel via WSS connection without reverse proxy, specify
--connection-min-idle 1
forwstunnel client
.Monitor server logs.
Run
curl --proxy socks5://localhost:xxxx https://ixbt.com/
inside the 10-seconds window betweenwstunnel::tunnel::server::server: Doing TLS handshake
andwstunnel::tunnel::server::server: Error while upgrading cnx: hyper::Error(HeaderTimeout)
:Run
curl --proxy socks5://localhost:xxxx https://ixbt.com/
outside the 10-seconds window:Expected behavior
Connections via tunnel work most of the time, idle WebSocket connections are fully opened and don't reconnect that often.
Your wstunnel setup
Paste your logs of wstunnel, started with
--log-lvl=DEBUG
, and with thecommand line used
(Host names and client-server IP addresses were redacted.)
/usr/bin/dumb-init -v -- /home/app/wstunnel client wss://wstunnel.host:443 --tls-verify-certificate -L socks5://0.0.0.0:1180 --connection-min-idle 1 --log-lvl=DEBUG
wstunnel server --log-lvl=DEBUG --tls-certificate /var/lib/acme/wstunnel.host.net/fullchain.pem --tls-private-key /var/lib/acme/wstunnel.host/key.pem wss://0.0.0.0:1443
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: