Closed pvgoran closed 1 month ago
Hello,
Thanks for reporting the issue. I am going to increase the timeout in order to play nice with the min-idle
flag in the next release.
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. Going to fix it when i am back from vacation (~2weeks)
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.
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.)
Nonetheless I understand it can flood the logs. Going to fix it when i am back from vacation (~2weeks)
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):