Add an option to disable MTU discovery

This commit is contained in:
Toby 2021-08-23 14:38:10 -07:00
parent db181d5849
commit 32b3dc65a0
4 changed files with 14 additions and 10 deletions

View File

@ -57,6 +57,7 @@ func client(config *clientConfig) {
InitialConnectionReceiveWindow: config.ReceiveWindow, InitialConnectionReceiveWindow: config.ReceiveWindow,
MaxConnectionReceiveWindow: config.ReceiveWindow, MaxConnectionReceiveWindow: config.ReceiveWindow,
KeepAlive: true, KeepAlive: true,
DisablePathMTUDiscovery: config.DisableMTUDiscovery,
EnableDatagrams: true, EnableDatagrams: true,
} }
if config.ReceiveWindowConn == 0 { if config.ReceiveWindowConn == 0 {

View File

@ -42,6 +42,7 @@ type serverConfig struct {
ReceiveWindowConn uint64 `json:"recv_window_conn"` ReceiveWindowConn uint64 `json:"recv_window_conn"`
ReceiveWindowClient uint64 `json:"recv_window_client"` ReceiveWindowClient uint64 `json:"recv_window_client"`
MaxConnClient int `json:"max_conn_client"` MaxConnClient int `json:"max_conn_client"`
DisableMTUDiscovery bool `json:"disable_mtu_discovery"`
} }
func (c *serverConfig) Check() error { func (c *serverConfig) Check() error {
@ -115,15 +116,16 @@ type clientConfig struct {
Listen string `json:"listen"` Listen string `json:"listen"`
Timeout int `json:"timeout"` Timeout int `json:"timeout"`
} `json:"tproxy_udp"` } `json:"tproxy_udp"`
ACL string `json:"acl"` ACL string `json:"acl"`
Obfs string `json:"obfs"` Obfs string `json:"obfs"`
Auth []byte `json:"auth"` Auth []byte `json:"auth"`
AuthString string `json:"auth_str"` AuthString string `json:"auth_str"`
ServerName string `json:"server_name"` ServerName string `json:"server_name"`
Insecure bool `json:"insecure"` Insecure bool `json:"insecure"`
CustomCA string `json:"ca"` CustomCA string `json:"ca"`
ReceiveWindowConn uint64 `json:"recv_window_conn"` ReceiveWindowConn uint64 `json:"recv_window_conn"`
ReceiveWindow uint64 `json:"recv_window"` ReceiveWindow uint64 `json:"recv_window"`
DisableMTUDiscovery bool `json:"disable_mtu_discovery"`
} }
func (c *clientConfig) Check() error { func (c *clientConfig) Check() error {

View File

@ -61,6 +61,7 @@ func server(config *serverConfig) {
MaxConnectionReceiveWindow: config.ReceiveWindowClient, MaxConnectionReceiveWindow: config.ReceiveWindowClient,
MaxIncomingStreams: int64(config.MaxConnClient), MaxIncomingStreams: int64(config.MaxConnClient),
KeepAlive: true, KeepAlive: true,
DisablePathMTUDiscovery: config.DisableMTUDiscovery,
EnableDatagrams: true, EnableDatagrams: true,
} }
if config.ReceiveWindowConn == 0 { if config.ReceiveWindowConn == 0 {

2
go.mod
View File

@ -11,7 +11,7 @@ require (
github.com/elazarl/goproxy/ext v0.0.0-20210110162100-a92cc753f88e github.com/elazarl/goproxy/ext v0.0.0-20210110162100-a92cc753f88e
github.com/eycorsican/go-tun2socks v1.16.11 github.com/eycorsican/go-tun2socks v1.16.11
github.com/hashicorp/golang-lru v0.5.4 github.com/hashicorp/golang-lru v0.5.4
github.com/lucas-clemente/quic-go v0.20.1 github.com/lucas-clemente/quic-go v0.22.0
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/prometheus/client_golang v1.11.0 github.com/prometheus/client_golang v1.11.0