Comments (6)
It doesn't handle closes automatically. The issue in versions of this package between v1.0.1 and 1.1.0 is that the WaitGroup was implemented incorrectly; the counter was never incremented to begin with.
The latest version (currently v1.1.1) does not use the sync
package anymore. Instead the tunnel is kept alive using a new function that waits for new connections and Close()
behaves as expected.
from sshtunnel.
@isaaguilar thank you!
I am using v1.1.0 I see now.
will get back when I have tested it with Closing the tunnel.
from sshtunnel.
Amazing now it works to close the tunnels
from sshtunnel.
@isaaguilar
Now that I have the ability to Close the tunnel. I am experiencing a bit of error logs from the tunnel implementation.
// Start the server in the background. You will need to wait a
// small amount of time for it to bind to the localhost port
// before you can start sending connections.
go tunnel.Start()
defer func() {
time.Sleep(5 * time.Second)
tunnel.Close()
}()
Even if I wait 5 seconds for the tunnel to get any io.Copys out of the way (and I am not creating anything or so) I still get an error of io.Copy
2020/09/22 16:44:33.035361 accepted connection
2020/09/22 16:44:33.035380 listening for new connections...
2020/09/22 16:44:33.076055 connected to 11.11.11.11:22 (1 of 2)
2020/09/22 16:44:33.078677 connected to 22.22.22.22:22 (2 of 2)
2020/09/22 16:44:39.385185 close signal received, closing...
2020/09/22 16:44:39.385195 closing the netConn (1 of 2)
2020/09/22 16:44:39.385304 io.Copy error: read tcp 127.0.0.1:2000->127.0.0.1:40330: use of closed network connection
2020/09/22 16:44:39.385311 closing the netConn (2 of 2)
2020/09/22 16:44:39.385416 closing the serverConn (1 of 1)
2020/09/22 16:44:39.386128 tunnel closed
from sshtunnel.
Please open a new ticket.
from sshtunnel.
will do
from sshtunnel.
Related Issues (9)
- Add PrivateKeyFileWithPassphrase HOT 1
- Start server without go routine? HOT 2
- Can sshtunnel handle Remote Port Forwarding
- Hangs if connection to SSH host fails HOT 3
- Thank you! Your module is very helpful, and it saved my time, but there is an improvement that I should say... HOT 1
- Possibility to specify the Local port of a forwarded Port HOT 3
- Tunnel closed if forwarded connection is not in use anymore HOT 3
- io.Copy Error for closing tunnel HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sshtunnel.