outline-go-tun2socks icon indicating copy to clipboard operation
outline-go-tun2socks copied to clipboard

Remove or extend UDP listening timeout

Open fortuna opened this issue 2 years ago • 1 comments

If a read hits the timeout, we stop listening for packets: https://github.com/Jigsaw-Code/outline-go-tun2socks/blob/ab0408a6d301b3a55105b94255c1d436c4f6480d/shadowsocks/udp.go#L52-L56

I wonder if this is causing issues with apps that use UDP, specially in extreme conditions.

The default timeout is 30 seconds: https://github.com/Jigsaw-Code/outline-go-tun2socks/blob/2f14928f97f3730e8c5c387003284db8fc12b445/outline/tunnel.go#L84

It's not clear to me that we need the timeout. Tun2socks stack will supposedly call udpHandler.Close() when the app socket is closed.

My suggestion is to remove the timeout. At least make is longer, like the 5 minutes we use on the server: https://github.com/Jigsaw-Code/outline-ss-server/blob/8269318bb6268f9de5b289c31a59da7617520ce8/server.go#L50-L51

fortuna avatar Feb 01 '23 01:02 fortuna