Skip to content
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

Make reverse tunnel timeout configurable #403

Closed
opopops opened this issue Jan 29, 2025 · 3 comments
Closed

Make reverse tunnel timeout configurable #403

opopops opened this issue Jan 29, 2025 · 3 comments

Comments

@opopops
Copy link

opopops commented Jan 29, 2025

Describe the feature

When I configure a client to connect to the server by establishing a SOCKS5 reverse tunnel in this way:

wstunnel client --remote-to-local socks socks5://0.0.0.0:1080 wss://myRemoteHost:443

When the client disconnects, the SOCKS tunnel remains open and continues to bind to 0.0.0.0:1080on the server for 3 minutes.
It seems that this delay is hardcoded here in the code

It would be interesting to make this delay configurable via a flag for the ‘server’ subcommand.

Describe the reason for such feature

The problem is that I use an NGINX reverse proxy as a TCP load balancer to distribute the load across multiple WSTunnel servers for High Availability. As long as the server remains bound to port 1080, NGINX LB considers it ‘healthy" and this causes errors when requesting HTTP URLs through the SOCKS proxy.

@erebe
Copy link
Owner

erebe commented Feb 1, 2025

Hello,

Thanks for reporting, I will try to add an option to make this configurable in the coming week.
I am letting you know.

Out of curiosity, in which context are you using wstunnel ?

@opopops
Copy link
Author

opopops commented Feb 1, 2025

Awesome! Thanks a lot for this. 🙏

About my use case, I’m using WSTunnel in a professional context to enable HTTP communication between two of apps deployed on different Kubernetes clusters. The challenge is that App 1 is on a highly secure network that App 2 cannot access. To solve this, I establish a SOCKS5 tunnel between the two clusters using WSTunnel.

@erebe
Copy link
Owner

erebe commented Feb 5, 2025

Should be good in latest release https://github.com/erebe/wstunnel/releases/tag/v10.1.9

You have a new flag on the server --remote-to-local-server-idle-timeout 10s to specify the timeout

@erebe erebe closed this as completed Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants