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

Commit

Permalink
Increase the UDP timeout
Browse files Browse the repository at this point in the history
This may address some issues with UDP.
Fixes #109.
  • Loading branch information
fortuna authored Feb 1, 2023
1 parent ab0408a commit aa1001f
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit aa1001f

Please sign in to comment.