mirror of
https://github.com/XTLS/Xray-docs-next.git
synced 2026-09-22 22:38:05 +03:00
Sockopt: Add network
This commit is contained in:
@@ -244,6 +244,7 @@ PS: 如果有正常上网的域名流量被 AsIs 的 freedom 出站送过来,
|
||||
"customSockopt": [
|
||||
{
|
||||
"system": "linux",
|
||||
"network": "tcp",
|
||||
"type": "str",
|
||||
"level": "6",
|
||||
"opt": "13",
|
||||
@@ -257,13 +258,17 @@ PS: 如果有正常上网的域名流量被 AsIs 的 freedom 出站送过来,
|
||||
|
||||
可选,指定生效的系统,如果运行的系统不匹配则跳过该 sockopt. 目前可选 `linux` `windows` `darwin` (全部小写). 若留空则直接执行
|
||||
|
||||
> `network`: ""
|
||||
|
||||
可选,指定生效的网络类型,目前可选 `tcp` `tcp4` `tcp6` `udp` `udp4` `udp6`. 无后缀数字代表执行双栈都应用该 sockopt。 注意目标是 IPv4 **不代表**标准库传入的 network 一定是 `tcp4`/`udp4`,比如系统有可能使用 IPv6 Socket 来连接一个 IPv4 地址,使用前请确认标准库行为。
|
||||
|
||||
> `type`: ""
|
||||
|
||||
必填,设置的类型,目前可选int或str.
|
||||
必填,设置的类型,目前可选 `int` 或 `str`.
|
||||
|
||||
> `level`: ""
|
||||
|
||||
可选,协议级别,用于指定生效范围,默认为6, 即TCP.
|
||||
可选,协议级别,用于指定生效范围,默认为 `6`, 即TCP.
|
||||
|
||||
> `opt`: ""
|
||||
|
||||
|
||||
@@ -240,6 +240,7 @@ Make sure you understand socket programming before using it.
|
||||
"customSockopt": [
|
||||
{
|
||||
"system": "linux",
|
||||
"network": "tcp",
|
||||
"type": "str",
|
||||
"level": "6",
|
||||
"opt": "13",
|
||||
@@ -253,6 +254,10 @@ Make sure you understand socket programming before using it.
|
||||
|
||||
Optional. Restricts the option to a specific operating system. If the current system does not match, the option is skipped. Supported values are `linux`, `windows`, and `darwin`, all in lowercase. If left empty, the option is applied directly.
|
||||
|
||||
> `network`: ""
|
||||
|
||||
Optional. Restricts the option to a specific network type. Supported values are `tcp`, `tcp4`, `tcp6`, `udp`, `udp4`, and `udp6`. A value without a numeric suffix means the sockopt is applied to both stacks. Note that an IPv4 target does **not** guarantee that the network passed in by the standard library is `tcp4`/`udp4` — for example, the system may use an IPv6 socket to connect to an IPv4 address. Verify the standard library behavior before using this.
|
||||
|
||||
> `type`: ""
|
||||
|
||||
Required. The value type to set. Currently `int` and `str` are supported.
|
||||
|
||||
@@ -238,6 +238,7 @@ Sockopt используется для настройки низкоуровн
|
||||
"customSockopt": [
|
||||
{
|
||||
"system": "linux",
|
||||
"network": "tcp",
|
||||
"type": "str",
|
||||
"level": "6",
|
||||
"opt": "13",
|
||||
@@ -251,6 +252,10 @@ Sockopt используется для настройки низкоуровн
|
||||
|
||||
Необязательный параметр. Ограничивает применение конкретной ОС. Если текущая система не совпадает, эта настройка пропускается. Поддерживаются `linux`, `windows` и `darwin`, все в нижнем регистре. Если поле пустое, настройка применяется напрямую.
|
||||
|
||||
> `network`: ""
|
||||
|
||||
Необязательный параметр. Ограничивает применение конкретным типом сети. Поддерживаются `tcp`, `tcp4`, `tcp6`, `udp`, `udp4`, `udp6`. Значение без числового суффикса означает, что sockopt применяется к обоим стекам. Обратите внимание: цель IPv4 **не означает**, что стандартная библиотека передаст network `tcp4`/`udp4` — например, система может использовать IPv6-сокет для подключения к IPv4-адресу. Перед использованием проверьте поведение стандартной библиотеки.
|
||||
|
||||
> `type`: ""
|
||||
|
||||
Обязательный параметр. Тип значения. Сейчас поддерживаются `int` и `str`.
|
||||
|
||||
Reference in New Issue
Block a user