Skip to content

Commit 2490f38

Browse files
authored
Sockopt: Update KeepAlive
1 parent 5e8104f commit 2490f38

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

docs/config/transport.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -702,29 +702,17 @@ OCSP 装订更新间隔,单位为秒,默认值为 0. 任意非 0 值将启
702702

703703
填写 `true` 时,最底层 TCP 连接建立后,请求方必须先发送 PROXY protocol v1 或 v2,否则连接会被关闭。
704704

705-
> `tcpKeepAliveInterval`: number
706-
707-
TCP 保持活跃的数据包发送间隔,单位为秒。~~该设置仅适用于 Linux 下。~~
708-
709-
它是连接不正常(未收到 ack)时候的心跳包。
710-
711-
不配置此项或配置为 0 表示使用 Go 默认值。
712-
713-
::: tip
714-
填负数时,如 `-1`,不启用 TCP 保持活跃。
715-
:::
716-
717705
> `tcpKeepAliveIdle`: number
718706
719707
TCP 空闲时间阈值,单位为秒。当 TCP 连接空闲时间达到这个阈值时,将开始发送 Keep-Alive 探测包。
720708

721-
它是连接正常时候的心跳包
709+
对于出站, xray 使用 Chrome 的默认值 idle 与 interval 均为 45s, 该选项与 `tcpKeepAliveInterval` 任意一个设置为负数将禁用该默认 keepalive, 正数则会覆盖该默认值
722710

723-
不配置此项或配置为 0 表示使用 Go 默认值
711+
对于入站, Keep-Alive 默认禁用,该选项与 `tcpKeepAliveInterval` 任意一个非零时启用,如果只设置二者之一那么另一个将跟随操作系统设置
724712

725-
::: tip
726-
填负数时,如 `-1`,不启用 TCP 保持活跃。
727-
:::
713+
> `tcpKeepAliveInterval`: number
714+
715+
TCP 进入 Keep-Alive 状态后发送 Keep-Alive 数据包间的时间间隔,单位为秒。其他行为见上。
728716

729717
> `tcpUserTimeout`: number
730718

0 commit comments

Comments
 (0)