opencoff / go-tunnel

TLS/SSL Tunnel - A modern STunnel replacement written in golang
GNU General Public License v2.0
294 stars 42 forks source link

Resume tunnel connection #8

Closed fegger-ducksify closed 2 years ago

fegger-ducksify commented 2 years ago

What will be my best option to resume client tunnel, if server get disconnected for a while. Actually I need to restart client side after an issue.

<3>:2021/12/15 11:55:38.290897 [gotun-127.0.0.1:1080] quic-client: gotun:4430: can't open new stream: Application error 0x0
<3>:2021/12/15 11:55:38.290905 [gotun-127.0.0.1:1080-127.0.0.1:54934] can't connect to gotun:4430: quic: gotun:4430: Application error 0x0

Is that something I could implement easily?

Thanks.

opencoff commented 2 years ago

Ah - thanks for pointing out this bug. The solution is in quickdial.go Dial() method. If the server restarts, then the cached session info on the client (q.dest[]) is now stale.

I pushed a patch to teach Dial() to invalidate the session cache when stream creation fails (v0.7.2); pls try and let me know if this worked.

fegger-ducksify commented 2 years ago

This works great! Thank you for this fix and your quick answer. cheers