Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Increase the UDP timeout #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion outline/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ func (t *outlinetunnel) UpdateUDPSupport() bool {
func (t *outlinetunnel) registerConnectionHandlers() {
var udpHandler core.UDPConnHandler
if t.isUDPEnabled {
udpHandler = oss.NewUDPHandler(t.client, 30*time.Second)
// Tun2socks will supposedly call udpHandler.Close() when the app socket is no longer needed.
// However, we set a timeout to be safe. A UDP NAT timeout of at least 5 minutes is recommended
// in RFC 4787 Section 4.3.
udpHandler = oss.NewUDPHandler(t.client, 5*time.Minute)
} else {
udpHandler = dnsfallback.NewUDPHandler()
}
Expand Down