diff --git a/lib/socks/client/handle.go b/lib/socks/client/handle.go index c4b3e23..8bba10b 100644 --- a/lib/socks/client/handle.go +++ b/lib/socks/client/handle.go @@ -5,16 +5,16 @@ import ( "fmt" "net" - "github.com/go-i2p/go-forward/config" "github.com/go-i2p/go-forward/packet" "github.com/go-i2p/go-forward/stream" + udpconst "github.com/go-i2p/go-i2ptunnel/lib/udp/const" "github.com/go-i2p/i2pkeys" "github.com/txthinking/socks5" ) var ( socksHandler socks5.Handler = &SOCKS{} - forwardConfig = config.DefaultConfig() + forwardConfig = udpconst.DatagramForwardConfig ) // TCPHandle implements socks5.Handler. diff --git a/lib/udp/const/const.go b/lib/udp/const/const.go new file mode 100644 index 0000000..a1bef91 --- /dev/null +++ b/lib/udp/const/const.go @@ -0,0 +1,15 @@ +package udpconst + +import ( + "time" + + "github.com/go-i2p/go-forward/config" +) + +var DatagramForwardConfig = &config.ForwardConfig{ + BufferSize: 32 * 1024, // 32KB buffer + IdleTimeout: 30 * time.Second, + MaxPacketSize: 65507 / 6, // Max UDP packet size + EnableMetrics: true, + ShutdownSignal: make(chan struct{}), +}