-
Notifications
You must be signed in to change notification settings - Fork 62
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
Tunnel closed if forwarded connection is not in use anymore #5
Comments
I believe this has been raised before. That it would be nice to allow reusing of connections. However, I'm not sure what this actually entails. If you find a fix, throw in a PR. |
Ok, I'll have a poke at it :) |
I've poked around a little bit and it's not a trivial change. I'll it sink for a bit, maybe another idea will come up. :) |
Fix the issue that was introduced in 1.1.0 where a listener would only accept a single connection. Instead track all the open connections in SSHTunnel.Conns (and SSHTunnel.SvrConns) and close all connections when SSHTunnel.Close() is called. I think this addresses the issue #5
Hello,
I was testing forwarding of ports and discovered that if you setup a tunnel and use the locally forwarded port, you can only use it once (example: one curl request), after that connection is closed by the client, the tunnel closes.
So basically, to reproduce the above, I create a tunnel and forward the RDP port of a windows machine that is accessible through a linux bastion host.
Then my program launches another program to open an RDP connection to that windows host.
If I close my RDP connection (the io.Copy error happens), then the tunnel closes.
Same symptom if I forward an HTTP port, I can do a cURL request just fine, but all subsequent requests will fail because the tunnel is closed.
In the above example, I'm create two tunnels, one to do SSH stuff and one to forward the 9200 port. (Thus the two "Tunnel Starting/Started" lines of log from my program)
Now I don't know if there's a logic flaw in my code or if it's an expected behaviour of the library.
Kind regards,
rnsc
The text was updated successfully, but these errors were encountered: