Set a lower max packet size

This commit is contained in:
eyedeekay
2025-02-07 13:35:55 -05:00
parent a475fd11fe
commit 6896d8ca87
2 changed files with 17 additions and 2 deletions

View File

@@ -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.

15
lib/udp/const/const.go Normal file
View File

@@ -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{}),
}