diff --git a/README.md b/README.md index 9624fd1..50b0409 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,8 @@ encryption. If you need a proxy, just use our proxy modes. "prometheus_listen": ":8080", // Prometheus HTTP metrics server listen address (at /metrics) "recv_window_conn": 15728640, // QUIC stream receive window "recv_window_client": 67108864, // QUIC connection receive window - "max_conn_client": 4096 // Max concurrent connections per client + "max_conn_client": 4096, // Max concurrent connections per client + "disable_mtu_discovery": false // Disable Path MTU Discovery (RFC 8899) } ``` @@ -300,7 +301,8 @@ hysteria_traffic_uplink_bytes_total{auth="aGFja2VyISE="} 37452 "insecure": false, // Ignore all certificate errors "ca": "my.ca", // Custom CA file "recv_window_conn": 15728640, // QUIC stream receive window - "recv_window": 67108864 // QUIC connection receive window + "recv_window": 67108864, // QUIC connection receive window + "disable_mtu_discovery": false // Disable Path MTU Discovery (RFC 8899) } ``` diff --git a/README.zh.md b/README.zh.md index 62dc408..2aee716 100644 --- a/README.zh.md +++ b/README.zh.md @@ -164,7 +164,8 @@ Hysteria 是一个功能丰富的,专为恶劣网络环境进行优化的网 "prometheus_listen": ":8080", // Prometheus 统计接口监听地址 (在 /metrics) "recv_window_conn": 15728640, // QUIC stream receive window "recv_window_client": 67108864, // QUIC connection receive window - "max_conn_client": 4096 // 单客户端最大活跃连接数 + "max_conn_client": 4096, // 单客户端最大活跃连接数 + "disable_mtu_discovery": false // 禁用 MTU 探测 (RFC 8899) } ``` @@ -285,7 +286,8 @@ hysteria_traffic_uplink_bytes_total{auth="aGFja2VyISE="} 37452 "insecure": false, // 忽略一切证书错误 "ca": "my.ca", // 自定义 CA "recv_window_conn": 15728640, // QUIC stream receive window - "recv_window": 67108864 // QUIC connection receive window + "recv_window": 67108864, // QUIC connection receive window + "disable_mtu_discovery": false // 禁用 MTU 探测 (RFC 8899) } ``` diff --git a/cmd/client.go b/cmd/client.go index 4a635fb..c9b9484 100644 --- a/cmd/client.go +++ b/cmd/client.go @@ -57,6 +57,7 @@ func client(config *clientConfig) { InitialConnectionReceiveWindow: config.ReceiveWindow, MaxConnectionReceiveWindow: config.ReceiveWindow, KeepAlive: true, + DisablePathMTUDiscovery: config.DisableMTUDiscovery, EnableDatagrams: true, } if config.ReceiveWindowConn == 0 { diff --git a/cmd/config.go b/cmd/config.go index 1723c94..800c9a5 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -42,6 +42,7 @@ type serverConfig struct { ReceiveWindowConn uint64 `json:"recv_window_conn"` ReceiveWindowClient uint64 `json:"recv_window_client"` MaxConnClient int `json:"max_conn_client"` + DisableMTUDiscovery bool `json:"disable_mtu_discovery"` } func (c *serverConfig) Check() error { @@ -115,15 +116,16 @@ type clientConfig struct { Listen string `json:"listen"` Timeout int `json:"timeout"` } `json:"tproxy_udp"` - ACL string `json:"acl"` - Obfs string `json:"obfs"` - Auth []byte `json:"auth"` - AuthString string `json:"auth_str"` - ServerName string `json:"server_name"` - Insecure bool `json:"insecure"` - CustomCA string `json:"ca"` - ReceiveWindowConn uint64 `json:"recv_window_conn"` - ReceiveWindow uint64 `json:"recv_window"` + ACL string `json:"acl"` + Obfs string `json:"obfs"` + Auth []byte `json:"auth"` + AuthString string `json:"auth_str"` + ServerName string `json:"server_name"` + Insecure bool `json:"insecure"` + CustomCA string `json:"ca"` + ReceiveWindowConn uint64 `json:"recv_window_conn"` + ReceiveWindow uint64 `json:"recv_window"` + DisableMTUDiscovery bool `json:"disable_mtu_discovery"` } func (c *clientConfig) Check() error { diff --git a/cmd/server.go b/cmd/server.go index c237620..dc56dfe 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -61,6 +61,7 @@ func server(config *serverConfig) { MaxConnectionReceiveWindow: config.ReceiveWindowClient, MaxIncomingStreams: int64(config.MaxConnClient), KeepAlive: true, + DisablePathMTUDiscovery: config.DisableMTUDiscovery, EnableDatagrams: true, } if config.ReceiveWindowConn == 0 {