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

Proposal: add pool of pre-established upstream TLS connections #3

Closed Snawoot closed 3 years ago

Snawoot commented 4 years ago

Hello, @opencoff

Wrapping SOCKS5 in TLS (alongside other uses of go-tunnel) is a nice idea and performs better for web surfing than conventional VPN tunnels.

However, TLS handshake for each new TCP connection adds significant connection delay which is undesired for good browsing experience. It is possible to cancel such delay if there is some amount of already established TLS connections to upstream server.

I've built such TLS pooling solution with Python (client) and haproxy (server), and I use it as SOCKS transport on daily basis. Today I've discovered your project and it appears to be more efficient and feature complete except TLS pooling.

It'll be nice to have such feature in go-tunnel in order to make it an VPN alternative suitable for everyday usage.

Unfortunately, I'm not proficient with Go and I'm not sure I can help with implementation of this feature, but I've decided to propose it. What do you think about it?

opencoff commented 4 years ago

Interesting idea. I'll explore it a bit more. Thanks.

Snawoot commented 4 years ago

I've rolled out and tested my own implementation, steady-tun. It's MIT licensed, so you may borrow any code or look for ideas if you like. Go feels good!

opencoff commented 4 years ago

I just added Quic support for the server & client side; this is more efficient and reliable than keeping TLS connection pool. I will next add native socks support to this: once done - it will be possible to setup a local gotun instance to act as TCP-SOCKS server relaying over Quic to a server that unpacks SOCKS and connects.