Pass timeout to PrepareConnection

This commit is contained in:
世界 2025-08-24 18:59:55 +08:00
parent 9532c7f1f6
commit ff4941daa4
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
7 changed files with 24 additions and 12 deletions

9
tun.go
View file

@ -7,6 +7,7 @@ import (
"runtime"
"strconv"
"strings"
"time"
"github.com/sagernet/sing/common/buf"
"github.com/sagernet/sing/common/control"
@ -18,7 +19,13 @@ import (
)
type Handler interface {
PrepareConnection(network string, source M.Socksaddr, destination M.Socksaddr, routeContext DirectRouteContext) (DirectRouteDestination, error)
PrepareConnection(
network string,
source M.Socksaddr,
destination M.Socksaddr,
routeContext DirectRouteContext,
timeout time.Duration,
) (DirectRouteDestination, error)
N.TCPConnectionHandlerEx
N.UDPConnectionHandlerEx
}