diff --git a/docs/configuration/outbound/naive.md b/docs/configuration/outbound/naive.md index 5ed9d2b8..8dfa9004 100644 --- a/docs/configuration/outbound/naive.md +++ b/docs/configuration/outbound/naive.md @@ -17,9 +17,11 @@ icon: material/new-box "password": "password", "insecure_concurrency": 0, "extra_headers": {}, + "stream_receive_window": "", "udp_over_tcp": false | {}, "quic": false, "quic_congestion_control": "", + "quic_session_receive_window": "", "tls": {}, ... // Dial Fields @@ -78,6 +80,14 @@ Number of concurrent tunnel connections. Multiple connections make the tunneling Extra headers to send in HTTP requests. +#### stream_receive_window + +The flow control window. + +When `quic` is enabled, it sets the initial QUIC stream receive window, and `6 MB` is used by default. + +Otherwise, it sets the HTTP/2 session receive window, the stream receive window is set to half of it, and `4 MB` is used by default on iOS, `128 MB` on other platforms. + #### udp_over_tcp UDP over TCP protocol settings. @@ -101,6 +111,16 @@ QUIC congestion control algorithm. `bbr` is used by default (the default of QUICHE, used by Chromium which NaiveProxy is based on). +#### quic_session_receive_window + +!!! note "" + + Only used when `quic` is enabled. + +The initial QUIC session receive window. + +`15 MB` is used by default. + #### tls ==Required== diff --git a/docs/configuration/outbound/naive.zh.md b/docs/configuration/outbound/naive.zh.md index dbfd7fbf..1e381863 100644 --- a/docs/configuration/outbound/naive.zh.md +++ b/docs/configuration/outbound/naive.zh.md @@ -17,9 +17,11 @@ icon: material/new-box "password": "password", "insecure_concurrency": 0, "extra_headers": {}, + "stream_receive_window": "", "udp_over_tcp": false | {}, "quic": false, "quic_congestion_control": "", + "quic_session_receive_window": "", "tls": {}, ... // 拨号字段 @@ -78,6 +80,14 @@ icon: material/new-box HTTP 请求中发送的额外头部。 +#### stream_receive_window + +流量控制窗口。 + +当 `quic` 启用时,它设置 QUIC 初始流接收窗口,默认使用 `6 MB`。 + +否则,它设置 HTTP/2 会话接收窗口,流接收窗口被设置为它的一半,在 iOS 上默认使用 `4 MB`,在其他平台上默认使用 `128 MB`。 + #### udp_over_tcp UDP over TCP 配置。 @@ -101,6 +111,16 @@ QUIC 拥塞控制算法。 默认使用 `bbr`(NaiveProxy 基于的 Chromium 使用的 QUICHE 的默认值)。 +#### quic_session_receive_window + +!!! note "" + + 仅在 `quic` 启用时使用。 + +QUIC 初始会话接收窗口。 + +默认使用 `15 MB`。 + #### tls ==必填== diff --git a/protocol/naive/outbound.go b/protocol/naive/outbound.go index 98bf8d97..0d4029b5 100644 --- a/protocol/naive/outbound.go +++ b/protocol/naive/outbound.go @@ -176,22 +176,24 @@ func NewOutbound(ctx context.Context, router adapter.Router, logger log.ContextL return nil, E.New("unknown quic congestion control: ", options.QUICCongestionControl) } client, err := cronet.NewNaiveClient(cronet.NaiveClientOptions{ - Context: ctx, - Logger: logger, - ServerAddress: serverAddress, - ServerName: serverName, - Username: options.Username, - Password: options.Password, - InsecureConcurrency: options.InsecureConcurrency, - ExtraHeaders: extraHeaders, - TrustedRootCertificates: trustedRootCertificates, - Dialer: outboundDialer, - DNSResolver: dnsResolver, - ECHEnabled: echEnabled, - ECHConfigList: echConfigList, - ECHQueryServerName: echQueryServerName, - QUIC: options.QUIC, - QUICCongestionControl: quicCongestionControl, + Context: ctx, + Logger: logger, + ServerAddress: serverAddress, + ServerName: serverName, + Username: options.Username, + Password: options.Password, + InsecureConcurrency: options.InsecureConcurrency, + ExtraHeaders: extraHeaders, + ReceiveWindow: options.ReceiveWindow.Value(), + TrustedRootCertificates: trustedRootCertificates, + Dialer: outboundDialer, + DNSResolver: dnsResolver, + ECHEnabled: echEnabled, + ECHConfigList: echConfigList, + ECHQueryServerName: echQueryServerName, + QUIC: options.QUIC, + QUICCongestionControl: quicCongestionControl, + QUICSessionReceiveWindow: options.QUICSessionReceiveWindow.Value(), }) if err != nil { return nil, err