Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aeb7308e81 | ||
|
|
bb1ebfda83 | ||
|
|
c05c798221 | ||
|
|
55b1bcc6a5 | ||
|
|
d6eddce420 | ||
|
|
4bf057139b | ||
|
|
a1b28b8282 | ||
|
|
d0aaf71770 | ||
|
|
2f31202c6b | ||
|
|
e4cc510712 | ||
|
|
e329bf6865 | ||
|
|
2badcec765 | ||
|
|
e71c13b1a2 | ||
|
|
a959a67ed3 | ||
|
|
a1044af579 | ||
|
|
a64b57451a | ||
|
|
f0e2318cbd | ||
|
|
ebec308fd8 | ||
|
|
ca094587be | ||
|
|
ca3b86c781 |
16
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
16
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -44,13 +44,7 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: Version
|
label: Version
|
||||||
description: If you are using the original command line program, please provide the output of the `sing-box version` command.
|
description: If you are using the original command line program, please provide the output of the `sing-box version` command.
|
||||||
value: |-
|
render: shell
|
||||||
<details>
|
|
||||||
|
|
||||||
```console
|
|
||||||
# Replace this line with the output
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Description
|
label: Description
|
||||||
@@ -70,10 +64,4 @@ body:
|
|||||||
If you encounter a crash with the graphical client, please provide crash logs.
|
If you encounter a crash with the graphical client, please provide crash logs.
|
||||||
For Apple platform clients, please check `Settings - View Service Log` for crash logs.
|
For Apple platform clients, please check `Settings - View Service Log` for crash logs.
|
||||||
For the Android client, please check the `/sdcard/Android/data/io.nekohasekai.sfa/files/stderr.log` file for crash logs.
|
For the Android client, please check the `/sdcard/Android/data/io.nekohasekai.sfa/files/stderr.log` file for crash logs.
|
||||||
value: |-
|
render: shell
|
||||||
<details>
|
|
||||||
|
|
||||||
```console
|
|
||||||
# Replace this line with logs
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
30
.github/ISSUE_TEMPLATE/bug_report_zh.yml
vendored
30
.github/ISSUE_TEMPLATE/bug_report_zh.yml
vendored
@@ -44,13 +44,7 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: 版本
|
label: 版本
|
||||||
description: 如果您使用原始命令行程序,请提供 `sing-box version` 命令的输出。
|
description: 如果您使用原始命令行程序,请提供 `sing-box version` 命令的输出。
|
||||||
value: |-
|
render: shell
|
||||||
<details>
|
|
||||||
|
|
||||||
```console
|
|
||||||
# 使用输出内容覆盖此行
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: 描述
|
label: 描述
|
||||||
@@ -70,10 +64,18 @@ body:
|
|||||||
如果您遭遇图形界面应用程序崩溃,请提供崩溃日志。
|
如果您遭遇图形界面应用程序崩溃,请提供崩溃日志。
|
||||||
对于 Apple 平台图形客户端程序,请检查 `Settings - View Service Log` 以导出崩溃日志。
|
对于 Apple 平台图形客户端程序,请检查 `Settings - View Service Log` 以导出崩溃日志。
|
||||||
对于 Android 图形客户端程序,请检查 `/sdcard/Android/data/io.nekohasekai.sfa/files/stderr.log` 文件以导出崩溃日志。
|
对于 Android 图形客户端程序,请检查 `/sdcard/Android/data/io.nekohasekai.sfa/files/stderr.log` 文件以导出崩溃日志。
|
||||||
value: |-
|
render: shell
|
||||||
<details>
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
```console
|
label: 完整性要求
|
||||||
# 使用日志内容覆盖此行
|
description: 我保证我提供了完整的可以在本地重现该问题的服务器、客户端配置文件与流程,而不是一个脱敏的复杂客户端配置文件,否则该 issue 将被关闭。
|
||||||
```
|
options:
|
||||||
</details>
|
- label: 我保证
|
||||||
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: 负责性要求
|
||||||
|
description: 我保证我阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值,否则该 issue 将被关闭。
|
||||||
|
options:
|
||||||
|
- label: 我保证
|
||||||
|
required: true
|
||||||
8
.github/workflows/debug.yml
vendored
8
.github/workflows/debug.yml
vendored
@@ -30,7 +30,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo go_version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
|
echo go_version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: ${{ steps.version.outputs.go_version }}
|
go-version: ${{ steps.version.outputs.go_version }}
|
||||||
- name: Add cache to Go proxy
|
- name: Add cache to Go proxy
|
||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.18.10
|
go-version: 1.18.10
|
||||||
- name: Cache go module
|
- name: Cache go module
|
||||||
@@ -74,7 +74,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.20.7
|
go-version: 1.20.7
|
||||||
- name: Cache go module
|
- name: Cache go module
|
||||||
@@ -209,7 +209,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo go_version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
|
echo go_version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: ${{ steps.version.outputs.go_version }}
|
go-version: ${{ steps.version.outputs.go_version }}
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|||||||
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -30,7 +30,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo go_version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
|
echo go_version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: ${{ steps.version.outputs.go_version }}
|
go-version: ${{ steps.version.outputs.go_version }}
|
||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
|
|||||||
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@@ -8,7 +8,7 @@ jobs:
|
|||||||
stale:
|
stale:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@v8
|
- uses: actions/stale@v9
|
||||||
with:
|
with:
|
||||||
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days'
|
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days'
|
||||||
days-before-stale: 60
|
days-before-stale: 60
|
||||||
|
|||||||
@@ -4,7 +4,15 @@ icon: material/alert-decagram
|
|||||||
|
|
||||||
# ChangeLog
|
# ChangeLog
|
||||||
|
|
||||||
#### 1.7.3
|
#### 1.7.6
|
||||||
|
|
||||||
|
* Fixes and improvements
|
||||||
|
|
||||||
|
#### 1.7.5
|
||||||
|
|
||||||
|
* Fixes and improvements
|
||||||
|
|
||||||
|
#### 1.7.4
|
||||||
|
|
||||||
* Fixes and improvements
|
* Fixes and improvements
|
||||||
|
|
||||||
@@ -25,8 +33,8 @@ by the Apple App Store, so updates to Apple Platforms will be delayed._
|
|||||||
|
|
||||||
Important changes since 1.6:
|
Important changes since 1.6:
|
||||||
|
|
||||||
* Add [exclude route support](/configuration/inbound/tun) for TUN inbound
|
* Add [exclude route support](/configuration/inbound/tun/) for TUN inbound
|
||||||
* Add `udp_disable_domain_unmapping` [inbound listen option](/configuration/shared/listen) **1**
|
* Add `udp_disable_domain_unmapping` [inbound listen option](/configuration/shared/listen/) **1**
|
||||||
* Add [HTTPUpgrade V2Ray transport](/configuration/shared/v2ray-transport#HTTPUpgrade) support **2**
|
* Add [HTTPUpgrade V2Ray transport](/configuration/shared/v2ray-transport#HTTPUpgrade) support **2**
|
||||||
* Migrate multiplex and UoT server to inbound **3**
|
* Migrate multiplex and UoT server to inbound **3**
|
||||||
* Add TCP Brutal support for multiplex **4**
|
* Add TCP Brutal support for multiplex **4**
|
||||||
@@ -56,7 +64,7 @@ and needs to be turned on explicitly in inbound options.
|
|||||||
**4**
|
**4**
|
||||||
|
|
||||||
Hysteria Brutal Congestion Control Algorithm in TCP. A kernel module needs to be installed on the Linux server,
|
Hysteria Brutal Congestion Control Algorithm in TCP. A kernel module needs to be installed on the Linux server,
|
||||||
see [TCP Brutal](/configuration/shared/tcp-brutal) for details.
|
see [TCP Brutal](/configuration/shared/tcp-brutal/) for details.
|
||||||
|
|
||||||
**5**:
|
**5**:
|
||||||
|
|
||||||
@@ -145,7 +153,7 @@ Only supported in graphical clients on Android and iOS.
|
|||||||
|
|
||||||
#### 1.6.1
|
#### 1.6.1
|
||||||
|
|
||||||
* Our [Android client](/installation/clients/sfa) is now available in the Google Play Store ▶️
|
* Our [Android client](/installation/clients/sfa/) is now available in the Google Play Store ▶️
|
||||||
* Fixes and improvements
|
* Fixes and improvements
|
||||||
|
|
||||||
#### 1.7.0-alpha.6
|
#### 1.7.0-alpha.6
|
||||||
@@ -165,7 +173,7 @@ options.
|
|||||||
**2**
|
**2**
|
||||||
|
|
||||||
Hysteria Brutal Congestion Control Algorithm in TCP. A kernel module needs to be installed on the Linux server,
|
Hysteria Brutal Congestion Control Algorithm in TCP. A kernel module needs to be installed on the Linux server,
|
||||||
see [TCP Brutal](/configuration/shared/tcp-brutal) for details.
|
see [TCP Brutal](/configuration/shared/tcp-brutal/) for details.
|
||||||
|
|
||||||
#### 1.7.0-alpha.3
|
#### 1.7.0-alpha.3
|
||||||
|
|
||||||
@@ -184,13 +192,13 @@ The new HTTPUpgrade transport has better performance than WebSocket and is bette
|
|||||||
|
|
||||||
Important changes since 1.5:
|
Important changes since 1.5:
|
||||||
|
|
||||||
* Our [Apple tvOS client](/installation/clients/sft) is now available in the App Store 🍎
|
* Our [Apple tvOS client](/installation/clients/sft/) is now available in the App Store 🍎
|
||||||
* Update BBR congestion control for TUIC and Hysteria2 **1**
|
* Update BBR congestion control for TUIC and Hysteria2 **1**
|
||||||
* Update brutal congestion control for Hysteria2
|
* Update brutal congestion control for Hysteria2
|
||||||
* Add `brutal_debug` option for Hysteria2
|
* Add `brutal_debug` option for Hysteria2
|
||||||
* Update legacy Hysteria protocol **2**
|
* Update legacy Hysteria protocol **2**
|
||||||
* Add TLS self sign key pair generate command
|
* Add TLS self sign key pair generate command
|
||||||
* Remove [Deprecated Features](/deprecated) by agreement
|
* Remove [Deprecated Features](/deprecated/) by agreement
|
||||||
|
|
||||||
**1**:
|
**1**:
|
||||||
|
|
||||||
@@ -208,8 +216,8 @@ the old protocol (Hysteria 1) have been updated to be consistent with Hysteria 2
|
|||||||
|
|
||||||
#### 1.7.0-alpha.1
|
#### 1.7.0-alpha.1
|
||||||
|
|
||||||
* Add [exclude route support](/configuration/inbound/tun) for TUN inbound
|
* Add [exclude route support](/configuration/inbound/tun/) for TUN inbound
|
||||||
* Add `udp_disable_domain_unmapping` [inbound listen option](/configuration/shared/listen) **1**
|
* Add `udp_disable_domain_unmapping` [inbound listen option](/configuration/shared/listen/) **1**
|
||||||
* Fixes and improvements
|
* Fixes and improvements
|
||||||
|
|
||||||
**1**:
|
**1**:
|
||||||
@@ -327,7 +335,7 @@ introduce new issues.
|
|||||||
|
|
||||||
#### 1.5.2
|
#### 1.5.2
|
||||||
|
|
||||||
* Our [Apple tvOS client](/installation/clients/sft) is now available in the App Store 🍎
|
* Our [Apple tvOS client](/installation/clients/sft/) is now available in the App Store 🍎
|
||||||
* Fixes and improvements
|
* Fixes and improvements
|
||||||
|
|
||||||
#### 1.6.0-alpha.3
|
#### 1.6.0-alpha.3
|
||||||
@@ -347,7 +355,7 @@ introduce new issues.
|
|||||||
* Update BBR congestion control for TUIC and Hysteria2 **1**
|
* Update BBR congestion control for TUIC and Hysteria2 **1**
|
||||||
* Update quic-go to v0.39.0
|
* Update quic-go to v0.39.0
|
||||||
* Update gVisor to 20230814.0
|
* Update gVisor to 20230814.0
|
||||||
* Remove [Deprecated Features](/deprecated) by agreement
|
* Remove [Deprecated Features](/deprecated/) by agreement
|
||||||
* Fixes and improvements
|
* Fixes and improvements
|
||||||
|
|
||||||
**1**:
|
**1**:
|
||||||
@@ -361,7 +369,7 @@ This update is intended to address the multi-send defects of the old implementat
|
|||||||
|
|
||||||
Important changes since 1.4:
|
Important changes since 1.4:
|
||||||
|
|
||||||
* Add TLS [ECH server](/configuration/shared/tls) support
|
* Add TLS [ECH server](/configuration/shared/tls/) support
|
||||||
* Improve TLS TCH client configuration
|
* Improve TLS TCH client configuration
|
||||||
* Add TLS ECH key pair generator **1**
|
* Add TLS ECH key pair generator **1**
|
||||||
* Add TLS ECH support for QUIC based protocols **2**
|
* Add TLS ECH support for QUIC based protocols **2**
|
||||||
@@ -370,7 +378,7 @@ Important changes since 1.4:
|
|||||||
* Add `interrupt_exist_connections` option for `Selector` and `URLTest` outbounds **4**
|
* Add `interrupt_exist_connections` option for `Selector` and `URLTest` outbounds **4**
|
||||||
* Add DNS01 challenge support for ACME TLS certificate issuer **5**
|
* Add DNS01 challenge support for ACME TLS certificate issuer **5**
|
||||||
* Add `merge` command **6**
|
* Add `merge` command **6**
|
||||||
* Mark [Deprecated Features](/deprecated)
|
* Mark [Deprecated Features](/deprecated/)
|
||||||
|
|
||||||
**1**:
|
**1**:
|
||||||
|
|
||||||
@@ -382,7 +390,7 @@ All inbounds and outbounds are supported, including `Naiveproxy`, `Hysteria[/2]`
|
|||||||
|
|
||||||
**3**:
|
**3**:
|
||||||
|
|
||||||
See [Hysteria2 inbound](/configuration/inbound/hysteria2) and [Hysteria2 outbound](/configuration/outbound/hysteria2)
|
See [Hysteria2 inbound](/configuration/inbound/hysteria2/) and [Hysteria2 outbound](/configuration/outbound/hysteria2/)
|
||||||
|
|
||||||
For protocol description, please refer to [https://v2.hysteria.network](https://v2.hysteria.network)
|
For protocol description, please refer to [https://v2.hysteria.network](https://v2.hysteria.network)
|
||||||
|
|
||||||
@@ -395,7 +403,7 @@ Only inbound connections are affected by this setting, internal connections will
|
|||||||
**5**:
|
**5**:
|
||||||
|
|
||||||
Only `Alibaba Cloud DNS` and `Cloudflare` are supported, see [ACME Fields](/configuration/shared/tls#acme-fields)
|
Only `Alibaba Cloud DNS` and `Cloudflare` are supported, see [ACME Fields](/configuration/shared/tls#acme-fields)
|
||||||
and [DNS01 Challenge Fields](/configuration/shared/dns01_challenge).
|
and [DNS01 Challenge Fields](/configuration/shared/dns01_challenge/).
|
||||||
|
|
||||||
**6**:
|
**6**:
|
||||||
|
|
||||||
@@ -477,7 +485,7 @@ Global Flags:
|
|||||||
|
|
||||||
Only `Alibaba Cloud DNS` and `Cloudflare` are supported,
|
Only `Alibaba Cloud DNS` and `Cloudflare` are supported,
|
||||||
see [ACME Fields](/configuration/shared/tls#acme-fields)
|
see [ACME Fields](/configuration/shared/tls#acme-fields)
|
||||||
and [DNS01 Challenge Fields](/configuration/shared/dns01_challenge).
|
and [DNS01 Challenge Fields](/configuration/shared/dns01_challenge/).
|
||||||
|
|
||||||
#### 1.5.0-beta.10
|
#### 1.5.0-beta.10
|
||||||
|
|
||||||
@@ -506,7 +514,7 @@ Only inbound connections are affected by this setting, internal connections will
|
|||||||
|
|
||||||
* Fix compatibility issues with official Hysteria2 server and client
|
* Fix compatibility issues with official Hysteria2 server and client
|
||||||
* Fixes and improvements
|
* Fixes and improvements
|
||||||
* Mark [deprecated features](/deprecated)
|
* Mark [deprecated features](/deprecated/)
|
||||||
|
|
||||||
#### 1.5.0-beta.3
|
#### 1.5.0-beta.3
|
||||||
|
|
||||||
@@ -525,13 +533,13 @@ Hysteria2 server and client when using `fastOpen=false` or UDP MTU >= 1200.
|
|||||||
|
|
||||||
**1**:
|
**1**:
|
||||||
|
|
||||||
See [Hysteria2 inbound](/configuration/inbound/hysteria2) and [Hysteria2 outbound](/configuration/outbound/hysteria2)
|
See [Hysteria2 inbound](/configuration/inbound/hysteria2/) and [Hysteria2 outbound](/configuration/outbound/hysteria2/)
|
||||||
|
|
||||||
For protocol description, please refer to [https://v2.hysteria.network](https://v2.hysteria.network)
|
For protocol description, please refer to [https://v2.hysteria.network](https://v2.hysteria.network)
|
||||||
|
|
||||||
#### 1.5.0-beta.1
|
#### 1.5.0-beta.1
|
||||||
|
|
||||||
* Add TLS [ECH server](/configuration/shared/tls) support
|
* Add TLS [ECH server](/configuration/shared/tls/) support
|
||||||
* Improve TLS TCH client configuration
|
* Improve TLS TCH client configuration
|
||||||
* Add TLS ECH key pair generator **1**
|
* Add TLS ECH key pair generator **1**
|
||||||
* Add TLS ECH support for QUIC based protocols **2**
|
* Add TLS ECH support for QUIC based protocols **2**
|
||||||
@@ -564,12 +572,12 @@ Important changes since 1.3:
|
|||||||
|
|
||||||
*1*:
|
*1*:
|
||||||
|
|
||||||
See [TUIC inbound](/configuration/inbound/tuic)
|
See [TUIC inbound](/configuration/inbound/tuic/)
|
||||||
and [TUIC outbound](/configuration/outbound/tuic)
|
and [TUIC outbound](/configuration/outbound/tuic/)
|
||||||
|
|
||||||
**2**:
|
**2**:
|
||||||
|
|
||||||
This is the TUIC port of the [UDP over TCP protocol](/configuration/shared/udp-over-tcp), designed to provide a QUIC
|
This is the TUIC port of the [UDP over TCP protocol](/configuration/shared/udp-over-tcp/), designed to provide a QUIC
|
||||||
stream based UDP relay mode that TUIC does not provide. Since it is an add-on protocol, you will need to use sing-box or
|
stream based UDP relay mode that TUIC does not provide. Since it is an add-on protocol, you will need to use sing-box or
|
||||||
another program compatible with the protocol as a server.
|
another program compatible with the protocol as a server.
|
||||||
|
|
||||||
@@ -600,7 +608,7 @@ Requires sing-box to be compiled with Go 1.21.
|
|||||||
|
|
||||||
**1**:
|
**1**:
|
||||||
|
|
||||||
This is the TUIC port of the [UDP over TCP protocol](/configuration/shared/udp-over-tcp), designed to provide a QUIC
|
This is the TUIC port of the [UDP over TCP protocol](/configuration/shared/udp-over-tcp/), designed to provide a QUIC
|
||||||
stream based UDP relay mode that TUIC does not provide. Since it is an add-on protocol, you will need to use sing-box or
|
stream based UDP relay mode that TUIC does not provide. Since it is an add-on protocol, you will need to use sing-box or
|
||||||
another program compatible with the protocol as a server.
|
another program compatible with the protocol as a server.
|
||||||
|
|
||||||
@@ -638,8 +646,8 @@ Requires sing-box to be compiled with Go 1.21.
|
|||||||
|
|
||||||
*1*:
|
*1*:
|
||||||
|
|
||||||
See [TUIC inbound](/configuration/inbound/tuic)
|
See [TUIC inbound](/configuration/inbound/tuic/)
|
||||||
and [TUIC outbound](/configuration/outbound/tuic)
|
and [TUIC outbound](/configuration/outbound/tuic/)
|
||||||
|
|
||||||
#### 1.3.6
|
#### 1.3.6
|
||||||
|
|
||||||
@@ -648,7 +656,7 @@ and [TUIC outbound](/configuration/outbound/tuic)
|
|||||||
#### 1.3.5
|
#### 1.3.5
|
||||||
|
|
||||||
* Fixes and improvements
|
* Fixes and improvements
|
||||||
* Introducing our [Apple tvOS](/installation/clients/sft) client applications **1**
|
* Introducing our [Apple tvOS](/installation/clients/sft/) client applications **1**
|
||||||
* Add per app proxy and app installed/updated trigger support for Android client
|
* Add per app proxy and app installed/updated trigger support for Android client
|
||||||
* Add profile sharing support for Android/iOS/macOS clients
|
* Add profile sharing support for Android/iOS/macOS clients
|
||||||
|
|
||||||
@@ -675,7 +683,7 @@ downloaded through TestFlight.
|
|||||||
|
|
||||||
#### 1.3.1-beta.3
|
#### 1.3.1-beta.3
|
||||||
|
|
||||||
* Introducing our [new iOS](/installation/clients/sfi) and [macOS](/installation/clients/sfm) client applications **1**
|
* Introducing our [new iOS](/installation/clients/sfi/) and [macOS](/installation/clients/sfm/) client applications **1**
|
||||||
* Fixes and improvements
|
* Fixes and improvements
|
||||||
|
|
||||||
**1**:
|
**1**:
|
||||||
@@ -696,7 +704,7 @@ The old testflight link and app are no longer valid.
|
|||||||
|
|
||||||
Important changes since 1.2:
|
Important changes since 1.2:
|
||||||
|
|
||||||
* Add [FakeIP](/configuration/dns/fakeip) support **1**
|
* Add [FakeIP](/configuration/dns/fakeip/) support **1**
|
||||||
* Improve multiplex **2**
|
* Improve multiplex **2**
|
||||||
* Add [DNS reverse mapping](/configuration/dns#reverse_mapping) support
|
* Add [DNS reverse mapping](/configuration/dns#reverse_mapping) support
|
||||||
* Add `rewrite_ttl` DNS rule action
|
* Add `rewrite_ttl` DNS rule action
|
||||||
@@ -723,11 +731,11 @@ Important changes since 1.2:
|
|||||||
|
|
||||||
*1*:
|
*1*:
|
||||||
|
|
||||||
See [FAQ](/faq/fakeip) for more information.
|
See [FAQ](/faq/fakeip/) for more information.
|
||||||
|
|
||||||
*2*:
|
*2*:
|
||||||
|
|
||||||
Added new `h2mux` multiplex protocol and `padding` multiplex option, see [Multiplex](/configuration/shared/multiplex).
|
Added new `h2mux` multiplex protocol and `padding` multiplex option, see [Multiplex](/configuration/shared/multiplex/).
|
||||||
|
|
||||||
#### 1.3-rc2
|
#### 1.3-rc2
|
||||||
|
|
||||||
@@ -789,7 +797,7 @@ Improved performance and reduced memory usage.
|
|||||||
|
|
||||||
*1*:
|
*1*:
|
||||||
|
|
||||||
Added new `h2mux` multiplex protocol and `padding` multiplex option, see [Multiplex](/configuration/shared/multiplex).
|
Added new `h2mux` multiplex protocol and `padding` multiplex option, see [Multiplex](/configuration/shared/multiplex/).
|
||||||
|
|
||||||
#### 1.2.6
|
#### 1.2.6
|
||||||
|
|
||||||
@@ -841,25 +849,25 @@ This is an incompatible update for XUDP in VLESS if vision flow is enabled.
|
|||||||
#### 1.3-beta1
|
#### 1.3-beta1
|
||||||
|
|
||||||
* Add [DNS reverse mapping](/configuration/dns#reverse_mapping) support
|
* Add [DNS reverse mapping](/configuration/dns#reverse_mapping) support
|
||||||
* Add [L3 routing](/configuration/route/ip-rule) support **1**
|
* Add [L3 routing](/configuration/route/ip-rule/) support **1**
|
||||||
* Add `rewrite_ttl` DNS rule action
|
* Add `rewrite_ttl` DNS rule action
|
||||||
* Add [FakeIP](/configuration/dns/fakeip) support **2**
|
* Add [FakeIP](/configuration/dns/fakeip/) support **2**
|
||||||
* Add `store_fakeip` Clash API option
|
* Add `store_fakeip` Clash API option
|
||||||
* Add multi-peer support for [WireGuard](/configuration/outbound/wireguard#peers) outbound
|
* Add multi-peer support for [WireGuard](/configuration/outbound/wireguard#peers) outbound
|
||||||
* Add loopback detect
|
* Add loopback detect
|
||||||
|
|
||||||
*1*:
|
*1*:
|
||||||
|
|
||||||
It can currently be used to [route connections directly to WireGuard](/examples/wireguard-direct) or block connections
|
It can currently be used to [route connections directly to WireGuard](/examples/wireguard-direct/) or block connections
|
||||||
at the IP layer.
|
at the IP layer.
|
||||||
|
|
||||||
*2*:
|
*2*:
|
||||||
|
|
||||||
See [FAQ](/faq/fakeip) for more information.
|
See [FAQ](/faq/fakeip/) for more information.
|
||||||
|
|
||||||
#### 1.2.3
|
#### 1.2.3
|
||||||
|
|
||||||
* Introducing our [new Android client application](/installation/clients/sfa)
|
* Introducing our [new Android client application](/installation/clients/sfa/)
|
||||||
* Improve UDP domain destination NAT
|
* Improve UDP domain destination NAT
|
||||||
* Update reality protocol
|
* Update reality protocol
|
||||||
* Fix TTL calculation for DNS response
|
* Fix TTL calculation for DNS response
|
||||||
@@ -888,16 +896,16 @@ to `domain` rule.
|
|||||||
|
|
||||||
Important changes since 1.1:
|
Important changes since 1.1:
|
||||||
|
|
||||||
* Introducing our [new iOS client application](/installation/clients/sfi)
|
* Introducing our [new iOS client application](/installation/clients/sfi/)
|
||||||
* Introducing [UDP over TCP protocol version 2](/configuration/shared/udp-over-tcp)
|
* Introducing [UDP over TCP protocol version 2](/configuration/shared/udp-over-tcp/)
|
||||||
* Add [platform options](/configuration/inbound/tun#platform) for tun inbound
|
* Add [platform options](/configuration/inbound/tun#platform) for tun inbound
|
||||||
* Add [ShadowTLS protocol v3](https://github.com/ihciah/shadow-tls/blob/master/docs/protocol-v3-en.md)
|
* Add [ShadowTLS protocol v3](https://github.com/ihciah/shadow-tls/blob/master/docs/protocol-v3-en.md)
|
||||||
* Add [VLESS server](/configuration/inbound/vless) and [vision](/configuration/outbound/vless#flow) support
|
* Add [VLESS server](/configuration/inbound/vless/) and [vision](/configuration/outbound/vless#flow) support
|
||||||
* Add [reality TLS](/configuration/shared/tls) support
|
* Add [reality TLS](/configuration/shared/tls/) support
|
||||||
* Add [NTP service](/configuration/ntp)
|
* Add [NTP service](/configuration/ntp/)
|
||||||
* Add [DHCP DNS server](/configuration/dns/server) support
|
* Add [DHCP DNS server](/configuration/dns/server/) support
|
||||||
* Add SSH [host key validation](/configuration/outbound/ssh) support
|
* Add SSH [host key validation](/configuration/outbound/ssh/) support
|
||||||
* Add [query_type](/configuration/dns/rule) DNS rule item
|
* Add [query_type](/configuration/dns/rule/) DNS rule item
|
||||||
* Add fallback support for v2ray transport
|
* Add fallback support for v2ray transport
|
||||||
* Add custom TLS server support for http based v2ray transports
|
* Add custom TLS server support for http based v2ray transports
|
||||||
* Add health check support for http-based v2ray transports
|
* Add health check support for http-based v2ray transports
|
||||||
@@ -928,7 +936,7 @@ name.
|
|||||||
|
|
||||||
#### 1.2-beta9
|
#### 1.2-beta9
|
||||||
|
|
||||||
* Introducing the [UDP over TCP protocol version 2](/configuration/shared/udp-over-tcp)
|
* Introducing the [UDP over TCP protocol version 2](/configuration/shared/udp-over-tcp/)
|
||||||
* Add health check support for http-based v2ray transports
|
* Add health check support for http-based v2ray transports
|
||||||
* Remove length limit on short_id for reality TLS config
|
* Remove length limit on short_id for reality TLS config
|
||||||
* Fix bugs and update dependencies
|
* Fix bugs and update dependencies
|
||||||
@@ -945,7 +953,7 @@ name.
|
|||||||
|
|
||||||
#### 1.2-beta6
|
#### 1.2-beta6
|
||||||
|
|
||||||
* Introducing our [new iOS client application](/installation/clients/sfi)
|
* Introducing our [new iOS client application](/installation/clients/sfi/)
|
||||||
* Add [platform options](/configuration/inbound/tun#platform) for tun inbound
|
* Add [platform options](/configuration/inbound/tun#platform) for tun inbound
|
||||||
* Add custom TLS server support for http based v2ray transports
|
* Add custom TLS server support for http based v2ray transports
|
||||||
* Add generate commands
|
* Add generate commands
|
||||||
@@ -958,8 +966,8 @@ name.
|
|||||||
|
|
||||||
#### 1.2-beta5
|
#### 1.2-beta5
|
||||||
|
|
||||||
* Add [VLESS server](/configuration/inbound/vless) and [vision](/configuration/outbound/vless#flow) support
|
* Add [VLESS server](/configuration/inbound/vless/) and [vision](/configuration/outbound/vless#flow) support
|
||||||
* Add [reality TLS](/configuration/shared/tls) support
|
* Add [reality TLS](/configuration/shared/tls/) support
|
||||||
* Fix match private address
|
* Fix match private address
|
||||||
|
|
||||||
#### 1.1.6
|
#### 1.1.6
|
||||||
@@ -974,7 +982,7 @@ name.
|
|||||||
|
|
||||||
#### 1.2-beta4
|
#### 1.2-beta4
|
||||||
|
|
||||||
* Add [NTP service](/configuration/ntp)
|
* Add [NTP service](/configuration/ntp/)
|
||||||
* Add Add multiple server names and multi-user support for shadowtls
|
* Add Add multiple server names and multi-user support for shadowtls
|
||||||
* Add strict mode support for shadowtls v3
|
* Add strict mode support for shadowtls v3
|
||||||
* Add uTLS support for shadowtls v3
|
* Add uTLS support for shadowtls v3
|
||||||
@@ -994,9 +1002,9 @@ name.
|
|||||||
|
|
||||||
#### 1.2-beta1
|
#### 1.2-beta1
|
||||||
|
|
||||||
* Add [DHCP DNS server](/configuration/dns/server) support
|
* Add [DHCP DNS server](/configuration/dns/server/) support
|
||||||
* Add SSH [host key validation](/configuration/outbound/ssh) support
|
* Add SSH [host key validation](/configuration/outbound/ssh/) support
|
||||||
* Add [query_type](/configuration/dns/rule) DNS rule item
|
* Add [query_type](/configuration/dns/rule/) DNS rule item
|
||||||
* Add v2ray [user stats](/configuration/experimental#statsusers) api
|
* Add v2ray [user stats](/configuration/experimental#statsusers) api
|
||||||
* Add new clash DNS query api
|
* Add new clash DNS query api
|
||||||
* Improve vmess request
|
* Improve vmess request
|
||||||
@@ -1225,7 +1233,7 @@ and [ShadowTLS outbound](/configuration/outbound/shadowtls#version)
|
|||||||
|
|
||||||
#### 1.1-beta6
|
#### 1.1-beta6
|
||||||
|
|
||||||
* Add [URLTest outbound](/configuration/outbound/urltest)
|
* Add [URLTest outbound](/configuration/outbound/urltest/)
|
||||||
* Fix bugs in 1.1-beta5
|
* Fix bugs in 1.1-beta5
|
||||||
|
|
||||||
#### 1.1-beta5
|
#### 1.1-beta5
|
||||||
@@ -1257,8 +1265,8 @@ The default tun stack is changed to system.
|
|||||||
#### 1.1-beta4
|
#### 1.1-beta4
|
||||||
|
|
||||||
* Add internal simple-obfs and v2ray-plugin [Shadowsocks plugins](/configuration/outbound/shadowsocks#plugin)
|
* Add internal simple-obfs and v2ray-plugin [Shadowsocks plugins](/configuration/outbound/shadowsocks#plugin)
|
||||||
* Add [ShadowsocksR outbound](/configuration/outbound/shadowsocksr)
|
* Add [ShadowsocksR outbound](/configuration/outbound/shadowsocksr/)
|
||||||
* Add [VLESS outbound and XUDP](/configuration/outbound/vless)
|
* Add [VLESS outbound and XUDP](/configuration/outbound/vless/)
|
||||||
* Skip wait for hysteria tcp handshake response
|
* Skip wait for hysteria tcp handshake response
|
||||||
* Fix socks4 client
|
* Fix socks4 client
|
||||||
* Fix hysteria inbound
|
* Fix hysteria inbound
|
||||||
@@ -1285,7 +1293,7 @@ The default tun stack is changed to system.
|
|||||||
*1*:
|
*1*:
|
||||||
|
|
||||||
Switching modes using the Clash API, and `store-selected` are now supported,
|
Switching modes using the Clash API, and `store-selected` are now supported,
|
||||||
see [Experimental](/configuration/experimental).
|
see [Experimental](/configuration/experimental/).
|
||||||
|
|
||||||
*2*:
|
*2*:
|
||||||
|
|
||||||
@@ -1366,15 +1374,15 @@ and [Listen Fields](/configuration/shared/listen#udp_fragment).
|
|||||||
* Fix write trojan udp
|
* Fix write trojan udp
|
||||||
* Fix DNS routing
|
* Fix DNS routing
|
||||||
* Add attribute support for geosite
|
* Add attribute support for geosite
|
||||||
* Update documentation for [Dial Fields](/configuration/shared/dial)
|
* Update documentation for [Dial Fields](/configuration/shared/dial/)
|
||||||
|
|
||||||
#### 1.0-beta3
|
#### 1.0-beta3
|
||||||
|
|
||||||
* Add [chained inbound](/configuration/shared/listen#detour) support
|
* Add [chained inbound](/configuration/shared/listen#detour) support
|
||||||
* Add process_path rule item
|
* Add process_path rule item
|
||||||
* Add macOS redirect support
|
* Add macOS redirect support
|
||||||
* Add ShadowTLS [Inbound](/configuration/inbound/shadowtls), [Outbound](/configuration/outbound/shadowtls)
|
* Add ShadowTLS [Inbound](/configuration/inbound/shadowtls/), [Outbound](/configuration/outbound/shadowtls/)
|
||||||
and [Examples](/examples/shadowtls)
|
and [Examples](/examples/shadowtls/)
|
||||||
* Fix search android package in non-owner users
|
* Fix search android package in non-owner users
|
||||||
* Fix socksaddr type condition
|
* Fix socksaddr type condition
|
||||||
* Fix smux session status
|
* Fix smux session status
|
||||||
@@ -1418,7 +1426,7 @@ and [Listen Fields](/configuration/shared/listen#udp_fragment).
|
|||||||
|
|
||||||
##### 2022/08/23
|
##### 2022/08/23
|
||||||
|
|
||||||
* Add [V2Ray Transport](/configuration/shared/v2ray-transport) support for VMess and Trojan
|
* Add [V2Ray Transport](/configuration/shared/v2ray-transport/) support for VMess and Trojan
|
||||||
* Allow plain http request in Naive inbound (It can now be used with nginx)
|
* Allow plain http request in Naive inbound (It can now be used with nginx)
|
||||||
* Add proxy protocol support
|
* Add proxy protocol support
|
||||||
* Free memory after start
|
* Free memory after start
|
||||||
@@ -1427,13 +1435,13 @@ and [Listen Fields](/configuration/shared/listen#udp_fragment).
|
|||||||
|
|
||||||
##### 2022/08/22
|
##### 2022/08/22
|
||||||
|
|
||||||
* Add strategy setting for each [DNS server](/configuration/dns/server)
|
* Add strategy setting for each [DNS server](/configuration/dns/server/)
|
||||||
* Add bind address to outbound options
|
* Add bind address to outbound options
|
||||||
|
|
||||||
##### 2022/08/21
|
##### 2022/08/21
|
||||||
|
|
||||||
* Add [Tor outbound](/configuration/outbound/tor)
|
* Add [Tor outbound](/configuration/outbound/tor/)
|
||||||
* Add [SSH outbound](/configuration/outbound/ssh)
|
* Add [SSH outbound](/configuration/outbound/ssh/)
|
||||||
|
|
||||||
##### 2022/08/20
|
##### 2022/08/20
|
||||||
|
|
||||||
@@ -1447,8 +1455,8 @@ and [Listen Fields](/configuration/shared/listen#udp_fragment).
|
|||||||
|
|
||||||
##### 2022/08/19
|
##### 2022/08/19
|
||||||
|
|
||||||
* Add Hysteria [Inbound](/configuration/inbound/hysteria) and [Outbund](/configuration/outbound/hysteria)
|
* Add Hysteria [Inbound](/configuration/inbound/hysteria/) and [Outbund](/configuration/outbound/hysteria/)
|
||||||
* Add [ACME TLS certificate issuer](/configuration/shared/tls)
|
* Add [ACME TLS certificate issuer](/configuration/shared/tls/)
|
||||||
* Allow read config from stdin (-c stdin)
|
* Allow read config from stdin (-c stdin)
|
||||||
* Update gVisor to 20220815.0
|
* Update gVisor to 20220815.0
|
||||||
|
|
||||||
@@ -1466,11 +1474,11 @@ and [Listen Fields](/configuration/shared/listen#udp_fragment).
|
|||||||
##### 2022/08/16
|
##### 2022/08/16
|
||||||
|
|
||||||
* Add ip_version (route/dns) rule item
|
* Add ip_version (route/dns) rule item
|
||||||
* Add [WireGuard](/configuration/outbound/wireguard) outbound
|
* Add [WireGuard](/configuration/outbound/wireguard/) outbound
|
||||||
|
|
||||||
##### 2022/08/15
|
##### 2022/08/15
|
||||||
|
|
||||||
* Add uid, android user and package rules support in [Tun](/configuration/inbound/tun) routing.
|
* Add uid, android user and package rules support in [Tun](/configuration/inbound/tun/) routing.
|
||||||
|
|
||||||
##### 2022/08/13
|
##### 2022/08/13
|
||||||
|
|
||||||
@@ -1479,15 +1487,15 @@ and [Listen Fields](/configuration/shared/listen#udp_fragment).
|
|||||||
##### 2022/08/12
|
##### 2022/08/12
|
||||||
|
|
||||||
* Performance improvements
|
* Performance improvements
|
||||||
* Add UoT option for [SOCKS](/configuration/outbound/socks) outbound
|
* Add UoT option for [SOCKS](/configuration/outbound/socks/) outbound
|
||||||
|
|
||||||
##### 2022/08/11
|
##### 2022/08/11
|
||||||
|
|
||||||
* Add UoT option for [Shadowsocks](/configuration/outbound/shadowsocks) outbound, UoT support for all inbounds
|
* Add UoT option for [Shadowsocks](/configuration/outbound/shadowsocks/) outbound, UoT support for all inbounds
|
||||||
|
|
||||||
##### 2022/08/10
|
##### 2022/08/10
|
||||||
|
|
||||||
* Add full-featured [Naive](/configuration/inbound/naive) inbound
|
* Add full-featured [Naive](/configuration/inbound/naive/) inbound
|
||||||
* Fix default dns server option [#9] by iKirby
|
* Fix default dns server option [#9] by iKirby
|
||||||
|
|
||||||
##### 2022/08/09
|
##### 2022/08/09
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
Maintained by Project S to provide a unified experience and platform-specific functionality.
|
Maintained by Project S to provide a unified experience and platform-specific functionality.
|
||||||
|
|
||||||
| Platform | Client |
|
| Platform | Client |
|
||||||
|---------------------------------------|-----------------------------------------|
|
|---------------------------------------|------------------------------------------|
|
||||||
| :material-android: Android | [sing-box for Android](./android) |
|
| :material-android: Android | [sing-box for Android](./android/) |
|
||||||
| :material-apple: iOS/macOS/Apple tvOS | [sing-box for Apple platforms](./apple) |
|
| :material-apple: iOS/macOS/Apple tvOS | [sing-box for Apple platforms](./apple/) |
|
||||||
| :material-laptop: Desktop | Working in progress |
|
| :material-laptop: Desktop | Working in progress |
|
||||||
|
|
||||||
Some third-party projects that claim to use sing-box or use sing-box as a selling point are not listed here. The core
|
Some third-party projects that claim to use sing-box or use sing-box as a selling point are not listed here. The core
|
||||||
motivation of the maintainers of such projects is to acquire more users, and even though they provide friendly VPN
|
motivation of the maintainers of such projects is to acquire more users, and even though they provide friendly VPN
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
| 平台 | 客户端 |
|
| 平台 | 客户端 |
|
||||||
|---------------------------------------|-----------------------------------------|
|
|---------------------------------------|-----------------------------------------|
|
||||||
| :material-android: Android | [sing-box for Android](./android) |
|
| :material-android: Android | [sing-box for Android](./android/) |
|
||||||
| :material-apple: iOS/macOS/Apple tvOS | [sing-box for Apple platforms](./apple) |
|
| :material-apple: iOS/macOS/Apple tvOS | [sing-box for Apple platforms](./apple/) |
|
||||||
| :material-laptop: Desktop | 施工中 |
|
| :material-laptop: Desktop | 施工中 |
|
||||||
|
|
||||||
此处没有列出一些声称使用或以 sing-box 为卖点的第三方项目。此类项目维护者的动机是获得更多用户,即使它们提供友好的商业
|
此处没有列出一些声称使用或以 sing-box 为卖点的第三方项目。此类项目维护者的动机是获得更多用户,即使它们提供友好的商业
|
||||||
|
|||||||
@@ -23,9 +23,9 @@
|
|||||||
|
|
||||||
| Key | Format |
|
| Key | Format |
|
||||||
|----------|--------------------------------|
|
|----------|--------------------------------|
|
||||||
| `server` | List of [DNS Server](./server) |
|
| `server` | List of [DNS Server](./server/) |
|
||||||
| `rules` | List of [DNS Rule](./rule) |
|
| `rules` | List of [DNS Rule](./rule/) |
|
||||||
| `fakeip` | [FakeIP](./fakeip) |
|
| `fakeip` | [FakeIP](./fakeip/) |
|
||||||
|
|
||||||
#### final
|
#### final
|
||||||
|
|
||||||
@@ -62,4 +62,4 @@ problematic in environments such as macOS, where DNS is proxied and cached by th
|
|||||||
|
|
||||||
#### fakeip
|
#### fakeip
|
||||||
|
|
||||||
[FakeIP](./fakeip) settings.
|
[FakeIP](./fakeip/) settings.
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
|
|
||||||
### 字段
|
### 字段
|
||||||
|
|
||||||
| 键 | 格式 |
|
| 键 | 格式 |
|
||||||
|----------|------------------------|
|
|----------|-------------------------|
|
||||||
| `server` | 一组 [DNS 服务器](./server) |
|
| `server` | 一组 [DNS 服务器](./server/) |
|
||||||
| `rules` | 一组 [DNS 规则](./rule) |
|
| `rules` | 一组 [DNS 规则](./rule/) |
|
||||||
|
|
||||||
#### final
|
#### final
|
||||||
|
|
||||||
@@ -60,4 +60,4 @@
|
|||||||
|
|
||||||
#### fakeip
|
#### fakeip
|
||||||
|
|
||||||
[FakeIP](./fakeip) 设置。
|
[FakeIP](./fakeip/) 设置。
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
|
|
||||||
#### inbound
|
#### inbound
|
||||||
|
|
||||||
Tags of [Inbound](/configuration/inbound).
|
Tags of [Inbound](/configuration/inbound/).
|
||||||
|
|
||||||
#### ip_version
|
#### ip_version
|
||||||
|
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
|
|
||||||
#### inbound
|
#### inbound
|
||||||
|
|
||||||
[入站](/zh/configuration/inbound) 标签.
|
[入站](/zh/configuration/inbound/) 标签.
|
||||||
|
|
||||||
#### ip_version
|
#### ip_version
|
||||||
|
|
||||||
|
|||||||
@@ -30,18 +30,18 @@ The tag of the dns server.
|
|||||||
|
|
||||||
The address of the dns server.
|
The address of the dns server.
|
||||||
|
|
||||||
| Protocol | Format |
|
| Protocol | Format |
|
||||||
|-------------------------------------|-------------------------------|
|
|--------------------------------------|-------------------------------|
|
||||||
| `System` | `local` |
|
| `System` | `local` |
|
||||||
| `TCP` | `tcp://1.0.0.1` |
|
| `TCP` | `tcp://1.0.0.1` |
|
||||||
| `UDP` | `8.8.8.8` `udp://8.8.4.4` |
|
| `UDP` | `8.8.8.8` `udp://8.8.4.4` |
|
||||||
| `TLS` | `tls://dns.google` |
|
| `TLS` | `tls://dns.google` |
|
||||||
| `HTTPS` | `https://1.1.1.1/dns-query` |
|
| `HTTPS` | `https://1.1.1.1/dns-query` |
|
||||||
| `QUIC` | `quic://dns.adguard.com` |
|
| `QUIC` | `quic://dns.adguard.com` |
|
||||||
| `HTTP3` | `h3://8.8.8.8/dns-query` |
|
| `HTTP3` | `h3://8.8.8.8/dns-query` |
|
||||||
| `RCode` | `rcode://refused` |
|
| `RCode` | `rcode://refused` |
|
||||||
| `DHCP` | `dhcp://auto` or `dhcp://en0` |
|
| `DHCP` | `dhcp://auto` or `dhcp://en0` |
|
||||||
| [FakeIP](/configuration/dns/fakeip) | `fakeip` |
|
| [FakeIP](/configuration/dns/fakeip/) | `fakeip` |
|
||||||
|
|
||||||
!!! warning ""
|
!!! warning ""
|
||||||
|
|
||||||
|
|||||||
@@ -30,18 +30,18 @@ DNS 服务器的标签。
|
|||||||
|
|
||||||
DNS 服务器的地址。
|
DNS 服务器的地址。
|
||||||
|
|
||||||
| 协议 | 格式 |
|
| 协议 | 格式 |
|
||||||
|-------------------------------------|------------------------------|
|
|--------------------------------------|------------------------------|
|
||||||
| `System` | `local` |
|
| `System` | `local` |
|
||||||
| `TCP` | `tcp://1.0.0.1` |
|
| `TCP` | `tcp://1.0.0.1` |
|
||||||
| `UDP` | `8.8.8.8` `udp://8.8.4.4` |
|
| `UDP` | `8.8.8.8` `udp://8.8.4.4` |
|
||||||
| `TLS` | `tls://dns.google` |
|
| `TLS` | `tls://dns.google` |
|
||||||
| `HTTPS` | `https://1.1.1.1/dns-query` |
|
| `HTTPS` | `https://1.1.1.1/dns-query` |
|
||||||
| `QUIC` | `quic://dns.adguard.com` |
|
| `QUIC` | `quic://dns.adguard.com` |
|
||||||
| `HTTP3` | `h3://8.8.8.8/dns-query` |
|
| `HTTP3` | `h3://8.8.8.8/dns-query` |
|
||||||
| `RCode` | `rcode://refused` |
|
| `RCode` | `rcode://refused` |
|
||||||
| `DHCP` | `dhcp://auto` 或 `dhcp://en0` |
|
| `DHCP` | `dhcp://auto` 或 `dhcp://en0` |
|
||||||
| [FakeIP](/configuration/dns/fakeip) | `fakeip` |
|
| [FakeIP](/configuration/dns/fakeip/) | `fakeip` |
|
||||||
|
|
||||||
!!! warning ""
|
!!! warning ""
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
|
|||||||
@@ -15,24 +15,24 @@
|
|||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
| Type | Format | Injectable |
|
| Type | Format | Injectable |
|
||||||
|---------------|------------------------------|------------|
|
|---------------|-------------------------------|------------|
|
||||||
| `direct` | [Direct](./direct) | X |
|
| `direct` | [Direct](./direct/) | X |
|
||||||
| `mixed` | [Mixed](./mixed) | TCP |
|
| `mixed` | [Mixed](./mixed/) | TCP |
|
||||||
| `socks` | [SOCKS](./socks) | TCP |
|
| `socks` | [SOCKS](./socks/) | TCP |
|
||||||
| `http` | [HTTP](./http) | TCP |
|
| `http` | [HTTP](./http/) | TCP |
|
||||||
| `shadowsocks` | [Shadowsocks](./shadowsocks) | TCP |
|
| `shadowsocks` | [Shadowsocks](./shadowsocks/) | TCP |
|
||||||
| `vmess` | [VMess](./vmess) | TCP |
|
| `vmess` | [VMess](./vmess/) | TCP |
|
||||||
| `trojan` | [Trojan](./trojan) | TCP |
|
| `trojan` | [Trojan](./trojan/) | TCP |
|
||||||
| `naive` | [Naive](./naive) | X |
|
| `naive` | [Naive](./naive/) | X |
|
||||||
| `hysteria` | [Hysteria](./hysteria) | X |
|
| `hysteria` | [Hysteria](./hysteria/) | X |
|
||||||
| `shadowtls` | [ShadowTLS](./shadowtls) | TCP |
|
| `shadowtls` | [ShadowTLS](./shadowtls/) | TCP |
|
||||||
| `tuic` | [TUIC](./tuic) | X |
|
| `tuic` | [TUIC](./tuic/) | X |
|
||||||
| `hysteria2` | [Hysteria2](./hysteria2) | X |
|
| `hysteria2` | [Hysteria2](./hysteria2/) | X |
|
||||||
| `vless` | [VLESS](./vless) | TCP |
|
| `vless` | [VLESS](./vless/) | TCP |
|
||||||
| `tun` | [Tun](./tun) | X |
|
| `tun` | [Tun](./tun/) | X |
|
||||||
| `redirect` | [Redirect](./redirect) | X |
|
| `redirect` | [Redirect](./redirect/) | X |
|
||||||
| `tproxy` | [TProxy](./tproxy) | X |
|
| `tproxy` | [TProxy](./tproxy/) | X |
|
||||||
|
|
||||||
#### tag
|
#### tag
|
||||||
|
|
||||||
|
|||||||
@@ -17,22 +17,22 @@
|
|||||||
|
|
||||||
| 类型 | 格式 | 注入支持 |
|
| 类型 | 格式 | 注入支持 |
|
||||||
|---------------|------------------------------|------|
|
|---------------|------------------------------|------|
|
||||||
| `direct` | [Direct](./direct) | X |
|
| `direct` | [Direct](./direct/) | X |
|
||||||
| `mixed` | [Mixed](./mixed) | TCP |
|
| `mixed` | [Mixed](./mixed/) | TCP |
|
||||||
| `socks` | [SOCKS](./socks) | TCP |
|
| `socks` | [SOCKS](./socks/) | TCP |
|
||||||
| `http` | [HTTP](./http) | TCP |
|
| `http` | [HTTP](./http/) | TCP |
|
||||||
| `shadowsocks` | [Shadowsocks](./shadowsocks) | TCP |
|
| `shadowsocks` | [Shadowsocks](./shadowsocks/) | TCP |
|
||||||
| `vmess` | [VMess](./vmess) | TCP |
|
| `vmess` | [VMess](./vmess/) | TCP |
|
||||||
| `trojan` | [Trojan](./trojan) | TCP |
|
| `trojan` | [Trojan](./trojan/) | TCP |
|
||||||
| `naive` | [Naive](./naive) | X |
|
| `naive` | [Naive](./naive/) | X |
|
||||||
| `hysteria` | [Hysteria](./hysteria) | X |
|
| `hysteria` | [Hysteria](./hysteria/) | X |
|
||||||
| `shadowtls` | [ShadowTLS](./shadowtls) | TCP |
|
| `shadowtls` | [ShadowTLS](./shadowtls/) | TCP |
|
||||||
| `tuic` | [TUIC](./tuic) | X |
|
| `tuic` | [TUIC](./tuic/) | X |
|
||||||
| `hysteria2` | [Hysteria2](./hysteria2) | X |
|
| `hysteria2` | [Hysteria2](./hysteria2/) | X |
|
||||||
| `vless` | [VLESS](./vless) | TCP |
|
| `vless` | [VLESS](./vless/) | TCP |
|
||||||
| `tun` | [Tun](./tun) | X |
|
| `tun` | [Tun](./tun/) | X |
|
||||||
| `redirect` | [Redirect](./redirect) | X |
|
| `redirect` | [Redirect](./redirect/) | X |
|
||||||
| `tproxy` | [TProxy](./tproxy) | X |
|
| `tproxy` | [TProxy](./tproxy/) | X |
|
||||||
|
|
||||||
#### tag
|
#### tag
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
|
|||||||
@@ -15,4 +15,4 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### 字段
|
### 字段
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
@@ -66,11 +66,11 @@ Only available in the ShadowTLS protocol 3.
|
|||||||
|
|
||||||
==Required==
|
==Required==
|
||||||
|
|
||||||
Handshake server address and [Dial options](/configuration/shared/dial).
|
Handshake server address and [Dial options](/configuration/shared/dial/).
|
||||||
|
|
||||||
#### handshake_for_server_name
|
#### handshake_for_server_name
|
||||||
|
|
||||||
Handshake server address and [Dial options](/configuration/shared/dial) for specific server name.
|
Handshake server address and [Dial options](/configuration/shared/dial/) for specific server name.
|
||||||
|
|
||||||
Only available in the ShadowTLS protocol 2/3.
|
Only available in the ShadowTLS protocol 2/3.
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
@@ -65,4 +65,4 @@ See [Multiplex](/configuration/shared/multiplex#inbound) for details.
|
|||||||
|
|
||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
|
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport/).
|
||||||
|
|||||||
@@ -67,4 +67,4 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
|
|||||||
|
|
||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
|
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport/)。
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
"fc00::/7"
|
"fc00::/7"
|
||||||
],
|
],
|
||||||
"endpoint_independent_nat": false,
|
"endpoint_independent_nat": false,
|
||||||
|
"udp_timeout": "5m",
|
||||||
"stack": "system",
|
"stack": "system",
|
||||||
"include_interface": [
|
"include_interface": [
|
||||||
"lan0"
|
"lan0"
|
||||||
@@ -240,4 +241,4 @@ System HTTP proxy settings.
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
"fc00::/7"
|
"fc00::/7"
|
||||||
],
|
],
|
||||||
"endpoint_independent_nat": false,
|
"endpoint_independent_nat": false,
|
||||||
|
"udp_timeout": "5m",
|
||||||
"stack": "system",
|
"stack": "system",
|
||||||
"include_interface": [
|
"include_interface": [
|
||||||
"lan0"
|
"lan0"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
@@ -56,4 +56,4 @@ See [Multiplex](/configuration/shared/multiplex#inbound) for details.
|
|||||||
|
|
||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
|
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport/).
|
||||||
|
|||||||
@@ -56,4 +56,4 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
|
|||||||
|
|
||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
|
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport/)。
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
### Listen Fields
|
### Listen Fields
|
||||||
|
|
||||||
See [Listen Fields](/configuration/shared/listen) for details.
|
See [Listen Fields](/configuration/shared/listen/) for details.
|
||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
@@ -51,4 +51,4 @@ See [Multiplex](/configuration/shared/multiplex#inbound) for details.
|
|||||||
|
|
||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
|
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport/).
|
||||||
|
|||||||
@@ -51,4 +51,4 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
|
|||||||
|
|
||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
|
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport/)。
|
||||||
|
|||||||
@@ -18,15 +18,15 @@ sing-box uses JSON for configuration files.
|
|||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
| Key | Format |
|
| Key | Format |
|
||||||
|----------------|--------------------------------|
|
|----------------|---------------------------------|
|
||||||
| `log` | [Log](./log) |
|
| `log` | [Log](./log/) |
|
||||||
| `dns` | [DNS](./dns) |
|
| `dns` | [DNS](./dns/) |
|
||||||
| `ntp` | [NTP](./ntp) |
|
| `ntp` | [NTP](./ntp/) |
|
||||||
| `inbounds` | [Inbound](./inbound) |
|
| `inbounds` | [Inbound](./inbound/) |
|
||||||
| `outbounds` | [Outbound](./outbound) |
|
| `outbounds` | [Outbound](./outbound/) |
|
||||||
| `route` | [Route](./route) |
|
| `route` | [Route](./route/) |
|
||||||
| `experimental` | [Experimental](./experimental) |
|
| `experimental` | [Experimental](./experimental/) |
|
||||||
|
|
||||||
### Check
|
### Check
|
||||||
|
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ sing-box 使用 JSON 作为配置文件格式。
|
|||||||
|
|
||||||
### 字段
|
### 字段
|
||||||
|
|
||||||
| Key | Format |
|
| Key | Format |
|
||||||
|----------------|-----------------------|
|
|----------------|------------------------|
|
||||||
| `log` | [日志](./log) |
|
| `log` | [日志](./log/) |
|
||||||
| `dns` | [DNS](./dns) |
|
| `dns` | [DNS](./dns/) |
|
||||||
| `inbounds` | [入站](./inbound) |
|
| `inbounds` | [入站](./inbound/) |
|
||||||
| `outbounds` | [出站](./outbound) |
|
| `outbounds` | [出站](./outbound/) |
|
||||||
| `route` | [路由](./route) |
|
| `route` | [路由](./route/) |
|
||||||
| `experimental` | [实验性](./experimental) |
|
| `experimental` | [实验性](./experimental/) |
|
||||||
|
|
||||||
### 检查
|
### 检查
|
||||||
|
|
||||||
|
|||||||
@@ -47,4 +47,4 @@ Time synchronization interval.
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
@@ -33,4 +33,4 @@ Protocol value can be `1` or `2`.
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -55,4 +55,4 @@ TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -113,4 +113,4 @@ TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -88,4 +88,4 @@ Enable debug information logging for Hysteria Brutal CC.
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -15,27 +15,27 @@
|
|||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
| Type | Format |
|
| Type | Format |
|
||||||
|----------------|--------------------------------|
|
|----------------|---------------------------------|
|
||||||
| `direct` | [Direct](./direct) |
|
| `direct` | [Direct](./direct/) |
|
||||||
| `block` | [Block](./block) |
|
| `block` | [Block](./block/) |
|
||||||
| `socks` | [SOCKS](./socks) |
|
| `socks` | [SOCKS](./socks/) |
|
||||||
| `http` | [HTTP](./http) |
|
| `http` | [HTTP](./http/) |
|
||||||
| `shadowsocks` | [Shadowsocks](./shadowsocks) |
|
| `shadowsocks` | [Shadowsocks](./shadowsocks/) |
|
||||||
| `vmess` | [VMess](./vmess) |
|
| `vmess` | [VMess](./vmess/) |
|
||||||
| `trojan` | [Trojan](./trojan) |
|
| `trojan` | [Trojan](./trojan/) |
|
||||||
| `wireguard` | [Wireguard](./wireguard) |
|
| `wireguard` | [Wireguard](./wireguard/) |
|
||||||
| `hysteria` | [Hysteria](./hysteria) |
|
| `hysteria` | [Hysteria](./hysteria/) |
|
||||||
| `shadowsocksr` | [ShadowsocksR](./shadowsocksr) |
|
| `shadowsocksr` | [ShadowsocksR](./shadowsocksr/) |
|
||||||
| `vless` | [VLESS](./vless) |
|
| `vless` | [VLESS](./vless/) |
|
||||||
| `shadowtls` | [ShadowTLS](./shadowtls) |
|
| `shadowtls` | [ShadowTLS](./shadowtls/) |
|
||||||
| `tuic` | [TUIC](./tuic) |
|
| `tuic` | [TUIC](./tuic/) |
|
||||||
| `hysteria2` | [Hysteria2](./hysteria2) |
|
| `hysteria2` | [Hysteria2](./hysteria2/) |
|
||||||
| `tor` | [Tor](./tor) |
|
| `tor` | [Tor](./tor/) |
|
||||||
| `ssh` | [SSH](./ssh) |
|
| `ssh` | [SSH](./ssh/) |
|
||||||
| `dns` | [DNS](./dns) |
|
| `dns` | [DNS](./dns/) |
|
||||||
| `selector` | [Selector](./selector) |
|
| `selector` | [Selector](./selector/) |
|
||||||
| `urltest` | [URLTest](./urltest) |
|
| `urltest` | [URLTest](./urltest/) |
|
||||||
|
|
||||||
#### tag
|
#### tag
|
||||||
|
|
||||||
|
|||||||
@@ -15,27 +15,27 @@
|
|||||||
|
|
||||||
### 字段
|
### 字段
|
||||||
|
|
||||||
| 类型 | 格式 |
|
| 类型 | 格式 |
|
||||||
|----------------|--------------------------------|
|
|----------------|---------------------------------|
|
||||||
| `direct` | [Direct](./direct) |
|
| `direct` | [Direct](./direct/) |
|
||||||
| `block` | [Block](./block) |
|
| `block` | [Block](./block/) |
|
||||||
| `socks` | [SOCKS](./socks) |
|
| `socks` | [SOCKS](./socks/) |
|
||||||
| `http` | [HTTP](./http) |
|
| `http` | [HTTP](./http/) |
|
||||||
| `shadowsocks` | [Shadowsocks](./shadowsocks) |
|
| `shadowsocks` | [Shadowsocks](./shadowsocks/) |
|
||||||
| `vmess` | [VMess](./vmess) |
|
| `vmess` | [VMess](./vmess/) |
|
||||||
| `trojan` | [Trojan](./trojan) |
|
| `trojan` | [Trojan](./trojan/) |
|
||||||
| `wireguard` | [Wireguard](./wireguard) |
|
| `wireguard` | [Wireguard](./wireguard/) |
|
||||||
| `hysteria` | [Hysteria](./hysteria) |
|
| `hysteria` | [Hysteria](./hysteria/) |
|
||||||
| `shadowsocksr` | [ShadowsocksR](./shadowsocksr) |
|
| `shadowsocksr` | [ShadowsocksR](./shadowsocksr/) |
|
||||||
| `vless` | [VLESS](./vless) |
|
| `vless` | [VLESS](./vless/) |
|
||||||
| `shadowtls` | [ShadowTLS](./shadowtls) |
|
| `shadowtls` | [ShadowTLS](./shadowtls/) |
|
||||||
| `tuic` | [TUIC](./tuic) |
|
| `tuic` | [TUIC](./tuic/) |
|
||||||
| `hysteria2` | [Hysteria2](./hysteria2) |
|
| `hysteria2` | [Hysteria2](./hysteria2/) |
|
||||||
| `tor` | [Tor](./tor) |
|
| `tor` | [Tor](./tor/) |
|
||||||
| `ssh` | [SSH](./ssh) |
|
| `ssh` | [SSH](./ssh/) |
|
||||||
| `dns` | [DNS](./dns) |
|
| `dns` | [DNS](./dns/) |
|
||||||
| `selector` | [Selector](./selector) |
|
| `selector` | [Selector](./selector/) |
|
||||||
| `urltest` | [URLTest](./urltest) |
|
| `urltest` | [URLTest](./urltest/) |
|
||||||
|
|
||||||
#### tag
|
#### tag
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ Both is enabled by default.
|
|||||||
|
|
||||||
UDP over TCP configuration.
|
UDP over TCP configuration.
|
||||||
|
|
||||||
See [UDP Over TCP](/configuration/shared/udp-over-tcp) for details.
|
See [UDP Over TCP](/configuration/shared/udp-over-tcp/) for details.
|
||||||
|
|
||||||
Conflict with `multiplex`.
|
Conflict with `multiplex`.
|
||||||
|
|
||||||
@@ -99,4 +99,4 @@ See [Multiplex](/configuration/shared/multiplex#outbound) for details.
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ Shadowsocks SIP003 插件参数。
|
|||||||
|
|
||||||
UDP over TCP 配置。
|
UDP over TCP 配置。
|
||||||
|
|
||||||
参阅 [UDP Over TCP](/zh/configuration/shared/udp-over-tcp)。
|
参阅 [UDP Over TCP](/zh/configuration/shared/udp-over-tcp/)。
|
||||||
|
|
||||||
与 `multiplex` 冲突。
|
与 `multiplex` 冲突。
|
||||||
|
|
||||||
|
|||||||
@@ -103,4 +103,4 @@ Both is enabled by default.
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -53,4 +53,4 @@ TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ Both is enabled by default.
|
|||||||
|
|
||||||
UDP over TCP protocol settings.
|
UDP over TCP protocol settings.
|
||||||
|
|
||||||
See [UDP Over TCP](/configuration/shared/udp-over-tcp) for details.
|
See [UDP Over TCP](/configuration/shared/udp-over-tcp/) for details.
|
||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ SOCKS5 密码。
|
|||||||
|
|
||||||
UDP over TCP 配置。
|
UDP over TCP 配置。
|
||||||
|
|
||||||
参阅 [UDP Over TCP](/zh/configuration/shared/udp-over-tcp)。
|
参阅 [UDP Over TCP](/zh/configuration/shared/udp-over-tcp/)。
|
||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
|
|||||||
@@ -68,4 +68,4 @@ Client version. Random version will be used if empty.
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -48,4 +48,4 @@ See [tor(1)](https://linux.die.net/man/1/tor) for details.
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ See [Multiplex](/configuration/shared/multiplex#outbound) for details.
|
|||||||
|
|
||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
|
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport/).
|
||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#outbound)。
|
|||||||
|
|
||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
|
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport/)。
|
||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ Conflict with `udp_over_stream`.
|
|||||||
|
|
||||||
#### udp_over_stream
|
#### udp_over_stream
|
||||||
|
|
||||||
This is the TUIC port of the [UDP over TCP protocol](/configuration/shared/udp-over-tcp), designed to provide a QUIC
|
This is the TUIC port of the [UDP over TCP protocol](/configuration/shared/udp-over-tcp/), designed to provide a QUIC
|
||||||
stream based UDP relay mode that TUIC does not provide. Since it is an add-on protocol, you will need to use sing-box or
|
stream based UDP relay mode that TUIC does not provide. Since it is an add-on protocol, you will need to use sing-box or
|
||||||
another program compatible with the protocol as a server.
|
another program compatible with the protocol as a server.
|
||||||
|
|
||||||
@@ -97,4 +97,4 @@ TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ UDP 包中继模式
|
|||||||
|
|
||||||
#### udp_over_stream
|
#### udp_over_stream
|
||||||
|
|
||||||
这是 TUIC 的 [UDP over TCP 协议](/configuration/shared/udp-over-tcp) 移植, 旨在提供 TUIC 不提供的 基于 QUIC 流的 UDP 中继模式。 由于它是一个附加协议,因此您需要使用 sing-box 或其他兼容的程序作为服务器。
|
这是 TUIC 的 [UDP over TCP 协议](/configuration/shared/udp-over-tcp/) 移植, 旨在提供 TUIC 不提供的 基于 QUIC 流的 UDP 中继模式。 由于它是一个附加协议,因此您需要使用 sing-box 或其他兼容的程序作为服务器。
|
||||||
|
|
||||||
此模式在正确的 UDP 代理场景中没有任何积极作用,仅适用于中继流式 UDP 流量(基本上是 QUIC 流)。
|
此模式在正确的 UDP 代理场景中没有任何积极作用,仅适用于中继流式 UDP 流量(基本上是 QUIC 流)。
|
||||||
|
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ See [Multiplex](/configuration/shared/multiplex#outbound) for details.
|
|||||||
|
|
||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
|
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport/).
|
||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ UDP 包编码,默认使用 xudp。
|
|||||||
|
|
||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
|
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport/)。
|
||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ See [Multiplex](/configuration/shared/multiplex#outbound) for details.
|
|||||||
|
|
||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
|
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport/).
|
||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ UDP 包编码。
|
|||||||
|
|
||||||
#### transport
|
#### transport
|
||||||
|
|
||||||
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
|
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport/)。
|
||||||
|
|
||||||
### 拨号字段
|
### 拨号字段
|
||||||
|
|
||||||
|
|||||||
@@ -139,4 +139,4 @@ Both is enabled by default.
|
|||||||
|
|
||||||
### Dial Fields
|
### Dial Fields
|
||||||
|
|
||||||
See [Dial Fields](/configuration/shared/dial) for details.
|
See [Dial Fields](/configuration/shared/dial/) for details.
|
||||||
|
|||||||
@@ -19,11 +19,11 @@
|
|||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
| Key | Format |
|
| Key | Format |
|
||||||
|------------|------------------------------------|
|
|-----------|-------------------------------|
|
||||||
| `geoip` | [GeoIP](./geoip) |
|
| `geoip` | [GeoIP](./geoip/) |
|
||||||
| `geosite` | [Geosite](./geosite) |
|
| `geosite` | [Geosite](./geosite/) |
|
||||||
| `rules` | List of [Route Rule](./rule) |
|
| `rules` | List of [Route Rule](./rule/) |
|
||||||
|
|
||||||
#### final
|
#### final
|
||||||
|
|
||||||
|
|||||||
@@ -20,11 +20,11 @@
|
|||||||
|
|
||||||
### 字段
|
### 字段
|
||||||
|
|
||||||
| 键 | 格式 |
|
| 键 | 格式 |
|
||||||
|------------|-------------------------|
|
|-----------|-----------------------|
|
||||||
| `geoip` | [GeoIP](./geoip) |
|
| `geoip` | [GeoIP](./geoip/) |
|
||||||
| `geosite` | [GeoSite](./geosite) |
|
| `geosite` | [GeoSite](./geosite/) |
|
||||||
| `rules` | 一组 [路由规则](./rule) |
|
| `rules` | 一组 [路由规则](./rule/) |
|
||||||
|
|
||||||
#### final
|
#### final
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@
|
|||||||
|
|
||||||
#### inbound
|
#### inbound
|
||||||
|
|
||||||
Tags of [Inbound](/configuration/inbound).
|
Tags of [Inbound](/configuration/inbound/).
|
||||||
|
|
||||||
#### ip_version
|
#### ip_version
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
|
|
||||||
#### inbound
|
#### inbound
|
||||||
|
|
||||||
[入站](/zh/configuration/inbound) 标签。
|
[入站](/zh/configuration/inbound/) 标签。
|
||||||
|
|
||||||
#### ip_version
|
#### ip_version
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"tcp_fast_open": false,
|
"tcp_fast_open": false,
|
||||||
"tcp_multi_path": false,
|
"tcp_multi_path": false,
|
||||||
"udp_fragment": false,
|
"udp_fragment": false,
|
||||||
"udp_timeout": 300,
|
"udp_timeout": "5m",
|
||||||
"detour": "another-in",
|
"detour": "another-in",
|
||||||
"sniff": false,
|
"sniff": false,
|
||||||
"sniff_override_destination": false,
|
"sniff_override_destination": false,
|
||||||
@@ -19,14 +19,14 @@
|
|||||||
|
|
||||||
### Fields
|
### Fields
|
||||||
|
|
||||||
| Field | Available Context |
|
| Field | Available Context |
|
||||||
|--------------------------------|-------------------------------------------------------------------|
|
|--------------------------------|---------------------------------------------------------|
|
||||||
| `listen` | Needs to listen on TCP or UDP. |
|
| `listen` | Needs to listen on TCP or UDP. |
|
||||||
| `listen_port` | Needs to listen on TCP or UDP. |
|
| `listen_port` | Needs to listen on TCP or UDP. |
|
||||||
| `tcp_fast_open` | Needs to listen on TCP. |
|
| `tcp_fast_open` | Needs to listen on TCP. |
|
||||||
| `tcp_multi_path` | Needs to listen on TCP. |
|
| `tcp_multi_path` | Needs to listen on TCP. |
|
||||||
| `udp_timeout` | Needs to assemble UDP connections, currently Tun and Shadowsocks. |
|
| `udp_timeout` | Needs to assemble UDP connections. |
|
||||||
| `udp_disable_domain_unmapping` | Needs to listen on UDP and accept domain UDP addresses. |
|
| `udp_disable_domain_unmapping` | Needs to listen on UDP and accept domain UDP addresses. |
|
||||||
|
|
||||||
#### listen
|
#### listen
|
||||||
|
|
||||||
@@ -56,7 +56,9 @@ Enable UDP fragmentation.
|
|||||||
|
|
||||||
#### udp_timeout
|
#### udp_timeout
|
||||||
|
|
||||||
UDP NAT expiration time in seconds, default is 300 (5 minutes).
|
UDP NAT expiration time in seconds.
|
||||||
|
|
||||||
|
`5m` is used by default.
|
||||||
|
|
||||||
#### detour
|
#### detour
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"tcp_fast_open": false,
|
"tcp_fast_open": false,
|
||||||
"tcp_multi_path": false,
|
"tcp_multi_path": false,
|
||||||
"udp_fragment": false,
|
"udp_fragment": false,
|
||||||
"udp_timeout": 300,
|
"udp_timeout": "5m",
|
||||||
"detour": "another-in",
|
"detour": "another-in",
|
||||||
"sniff": false,
|
"sniff": false,
|
||||||
"sniff_override_destination": false,
|
"sniff_override_destination": false,
|
||||||
@@ -18,13 +18,13 @@
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
| 字段 | 可用上下文 |
|
| 字段 | 可用上下文 |
|
||||||
|-----------------------------------|-------------------------------------|
|
|------------------|-----------------|
|
||||||
| `listen` | 需要监听 TCP 或 UDP。 |
|
| `listen` | 需要监听 TCP 或 UDP。 |
|
||||||
| `listen_port` | 需要监听 TCP 或 UDP。 |
|
| `listen_port` | 需要监听 TCP 或 UDP。 |
|
||||||
| `tcp_fast_open` | 需要监听 TCP。 |
|
| `tcp_fast_open` | 需要监听 TCP。 |
|
||||||
| `tcp_multi_path` | 需要监听 TCP。 |
|
| `tcp_multi_path` | 需要监听 TCP。 |
|
||||||
| `udp_timeout` | 需要组装 UDP 连接, 当前为 Tun 和 Shadowsocks。 |
|
| `udp_timeout` | 需要组装 UDP 连接。 |
|
||||||
|
|
|
|
||||||
|
|
||||||
### 字段
|
### 字段
|
||||||
@@ -57,7 +57,9 @@
|
|||||||
|
|
||||||
#### udp_timeout
|
#### udp_timeout
|
||||||
|
|
||||||
UDP NAT 过期时间,以秒为单位,默认为 300(5 分钟)。
|
UDP NAT 过期时间,以秒为单位。
|
||||||
|
|
||||||
|
默认使用 `5m`。
|
||||||
|
|
||||||
#### detour
|
#### detour
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ If enabled, non-padded connections will be rejected.
|
|||||||
|
|
||||||
#### brutal
|
#### brutal
|
||||||
|
|
||||||
See [TCP Brutal](/configuration/shared/tcp-brutal) for details.
|
See [TCP Brutal](/configuration/shared/tcp-brutal/) for details.
|
||||||
|
|
||||||
### Outbound Fields
|
### Outbound Fields
|
||||||
|
|
||||||
@@ -83,4 +83,4 @@ Enable padding.
|
|||||||
|
|
||||||
#### brutal
|
#### brutal
|
||||||
|
|
||||||
See [TCP Brutal](/configuration/shared/tcp-brutal) for details.
|
See [TCP Brutal](/configuration/shared/tcp-brutal/) for details.
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#### brutal
|
#### brutal
|
||||||
|
|
||||||
参阅 [TCP Brutal](/zh/configuration/shared/tcp-brutal)。
|
参阅 [TCP Brutal](/zh/configuration/shared/tcp-brutal/)。
|
||||||
|
|
||||||
### 出站字段
|
### 出站字段
|
||||||
|
|
||||||
@@ -82,4 +82,4 @@
|
|||||||
|
|
||||||
#### brutal
|
#### brutal
|
||||||
|
|
||||||
参阅 [TCP Brutal](/zh/configuration/shared/tcp-brutal)。
|
参阅 [TCP Brutal](/zh/configuration/shared/tcp-brutal/)。
|
||||||
@@ -353,7 +353,7 @@ The MAC key.
|
|||||||
|
|
||||||
ACME DNS01 challenge field. If configured, other challenge methods will be disabled.
|
ACME DNS01 challenge field. If configured, other challenge methods will be disabled.
|
||||||
|
|
||||||
See [DNS01 Challenge Fields](/configuration/shared/dns01_challenge) for details.
|
See [DNS01 Challenge Fields](/configuration/shared/dns01_challenge/) for details.
|
||||||
|
|
||||||
### Reality Fields
|
### Reality Fields
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ See [DNS01 Challenge Fields](/configuration/shared/dns01_challenge) for details.
|
|||||||
|
|
||||||
==Required==
|
==Required==
|
||||||
|
|
||||||
Handshake server address and [Dial options](/configuration/shared/dial).
|
Handshake server address and [Dial options](/configuration/shared/dial/).
|
||||||
|
|
||||||
#### private_key
|
#### private_key
|
||||||
|
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ MAC 密钥。
|
|||||||
|
|
||||||
ACME DNS01 验证字段。如果配置,将禁用其他验证方法。
|
ACME DNS01 验证字段。如果配置,将禁用其他验证方法。
|
||||||
|
|
||||||
参阅 [DNS01 验证字段](/configuration/shared/dns01_challenge)。
|
参阅 [DNS01 验证字段](/configuration/shared/dns01_challenge/)。
|
||||||
|
|
||||||
### Reality 字段
|
### Reality 字段
|
||||||
|
|
||||||
|
|||||||
@@ -43,21 +43,21 @@ go build -tags "tag_a tag_b" ./cmd/sing-box
|
|||||||
|
|
||||||
## :material-folder-settings: Build Tags
|
## :material-folder-settings: Build Tags
|
||||||
|
|
||||||
| Build Tag | Enabled by default | Description |
|
| Build Tag | Enabled by default | Description |
|
||||||
|------------------------------------|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|------------------------------------|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `with_quic` | ✔ | Build with QUIC support, see [QUIC and HTTP3 DNS transports](/configuration/dns/server), [Naive inbound](/configuration/inbound/naive), [Hysteria Inbound](/configuration/inbound/hysteria), [Hysteria Outbound](/configuration/outbound/hysteria) and [V2Ray Transport#QUIC](/configuration/shared/v2ray-transport#quic). |
|
| `with_quic` | ✔ | Build with QUIC support, see [QUIC and HTTP3 DNS transports](/configuration/dns/server/), [Naive inbound](/configuration/inbound/naive/), [Hysteria Inbound](/configuration/inbound/hysteria/), [Hysteria Outbound](/configuration/outbound/hysteria/) and [V2Ray Transport#QUIC](/configuration/shared/v2ray-transport#quic). |
|
||||||
| `with_grpc` | ✖️ | Build with standard gRPC support, see [V2Ray Transport#gRPC](/configuration/shared/v2ray-transport#grpc). |
|
| `with_grpc` | ✖️ | Build with standard gRPC support, see [V2Ray Transport#gRPC](/configuration/shared/v2ray-transport#grpc). |
|
||||||
| `with_dhcp` | ✔ | Build with DHCP support, see [DHCP DNS transport](/configuration/dns/server). |
|
| `with_dhcp` | ✔ | Build with DHCP support, see [DHCP DNS transport](/configuration/dns/server/). |
|
||||||
| `with_wireguard` | ✔ | Build with WireGuard support, see [WireGuard outbound](/configuration/outbound/wireguard). |
|
| `with_wireguard` | ✔ | Build with WireGuard support, see [WireGuard outbound](/configuration/outbound/wireguard/). |
|
||||||
| `with_ech` | ✔ | Build with TLS ECH extension support for TLS outbound, see [TLS](/configuration/shared/tls#ech). |
|
| `with_ech` | ✔ | Build with TLS ECH extension support for TLS outbound, see [TLS](/configuration/shared/tls#ech). |
|
||||||
| `with_utls` | ✔ | Build with [uTLS](https://github.com/refraction-networking/utls) support for TLS outbound, see [TLS](/configuration/shared/tls#utls). |
|
| `with_utls` | ✔ | Build with [uTLS](https://github.com/refraction-networking/utls) support for TLS outbound, see [TLS](/configuration/shared/tls#utls). |
|
||||||
| `with_reality_server` | ✔ | Build with reality TLS server support, see [TLS](/configuration/shared/tls). |
|
| `with_reality_server` | ✔ | Build with reality TLS server support, see [TLS](/configuration/shared/tls/). |
|
||||||
| `with_acme` | ✔ | Build with ACME TLS certificate issuer support, see [TLS](/configuration/shared/tls). |
|
| `with_acme` | ✔ | Build with ACME TLS certificate issuer support, see [TLS](/configuration/shared/tls/). |
|
||||||
| `with_clash_api` | ✔ | Build with Clash API support, see [Experimental](/configuration/experimental#clash-api-fields). |
|
| `with_clash_api` | ✔ | Build with Clash API support, see [Experimental](/configuration/experimental#clash-api-fields). |
|
||||||
| `with_v2ray_api` | ✖️ | Build with V2Ray API support, see [Experimental](/configuration/experimental#v2ray-api-fields). |
|
| `with_v2ray_api` | ✖️ | Build with V2Ray API support, see [Experimental](/configuration/experimental#v2ray-api-fields). |
|
||||||
| `with_gvisor` | ✔ | Build with gVisor support, see [Tun inbound](/configuration/inbound/tun#stack) and [WireGuard outbound](/configuration/outbound/wireguard#system_interface). |
|
| `with_gvisor` | ✔ | Build with gVisor support, see [Tun inbound](/configuration/inbound/tun#stack) and [WireGuard outbound](/configuration/outbound/wireguard#system_interface). |
|
||||||
| `with_embedded_tor` (CGO required) | ✖️ | Build with embedded Tor support, see [Tor outbound](/configuration/outbound/tor). |
|
| `with_embedded_tor` (CGO required) | ✖️ | Build with embedded Tor support, see [Tor outbound](/configuration/outbound/tor/). |
|
||||||
| `with_lwip` (CGO required) | ✖️ | Build with LWIP Tun stack support, see [Tun inbound](/configuration/inbound/tun#stack). |
|
| `with_lwip` (CGO required) | ✖️ | Build with LWIP Tun stack support, see [Tun inbound](/configuration/inbound/tun#stack). |
|
||||||
|
|
||||||
|
|
||||||
It is not recommended to change the default build tag list unless you really know what you are adding.
|
It is not recommended to change the default build tag list unless you really know what you are adding.
|
||||||
|
|||||||
@@ -35,10 +35,6 @@ but only AEAD 2022 ciphers TCP with multiplexing is recommended.
|
|||||||
|
|
||||||
## :material-server: Server Example
|
## :material-server: Server Example
|
||||||
|
|
||||||
!!! info ""
|
|
||||||
|
|
||||||
Password of cipher `2022-blake3-aes-128-gcm` can be generated by command `sing-box generate rand 16 --base64`
|
|
||||||
|
|
||||||
=== ":material-account: Single-user"
|
=== ":material-account: Single-user"
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|||||||
@@ -4,10 +4,19 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"net/netip"
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box"
|
"github.com/sagernet/sing-box"
|
||||||
|
"github.com/sagernet/sing-box/adapter"
|
||||||
|
"github.com/sagernet/sing-box/common/process"
|
||||||
|
"github.com/sagernet/sing-box/experimental/libbox/platform"
|
||||||
"github.com/sagernet/sing-box/option"
|
"github.com/sagernet/sing-box/option"
|
||||||
|
"github.com/sagernet/sing-tun"
|
||||||
|
"github.com/sagernet/sing/common/control"
|
||||||
E "github.com/sagernet/sing/common/exceptions"
|
E "github.com/sagernet/sing/common/exceptions"
|
||||||
|
"github.com/sagernet/sing/common/logger"
|
||||||
|
"github.com/sagernet/sing/common/x/list"
|
||||||
)
|
)
|
||||||
|
|
||||||
func parseConfig(configContent string) (option.Options, error) {
|
func parseConfig(configContent string) (option.Options, error) {
|
||||||
@@ -27,8 +36,9 @@ func CheckConfig(configContent string) error {
|
|||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
instance, err := box.New(box.Options{
|
instance, err := box.New(box.Options{
|
||||||
Context: ctx,
|
Context: ctx,
|
||||||
Options: options,
|
Options: options,
|
||||||
|
PlatformInterface: (*platformInterfaceStub)(nil),
|
||||||
})
|
})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
instance.Close()
|
instance.Close()
|
||||||
@@ -36,6 +46,92 @@ func CheckConfig(configContent string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type platformInterfaceStub struct{}
|
||||||
|
|
||||||
|
func (s *platformInterfaceStub) Initialize(ctx context.Context, router adapter.Router) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *platformInterfaceStub) UsePlatformAutoDetectInterfaceControl() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *platformInterfaceStub) AutoDetectInterfaceControl() control.Func {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *platformInterfaceStub) OpenTun(options *tun.Options, platformOptions option.TunPlatformOptions) (tun.Tun, error) {
|
||||||
|
return nil, os.ErrInvalid
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *platformInterfaceStub) UsePlatformDefaultInterfaceMonitor() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *platformInterfaceStub) CreateDefaultInterfaceMonitor(logger logger.Logger) tun.DefaultInterfaceMonitor {
|
||||||
|
return (*interfaceMonitorStub)(nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *platformInterfaceStub) UsePlatformInterfaceGetter() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *platformInterfaceStub) Interfaces() ([]platform.NetworkInterface, error) {
|
||||||
|
return nil, os.ErrInvalid
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *platformInterfaceStub) UnderNetworkExtension() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *platformInterfaceStub) ClearDNSCache() {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *platformInterfaceStub) ReadWIFIState() adapter.WIFIState {
|
||||||
|
return adapter.WIFIState{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *platformInterfaceStub) FindProcessInfo(ctx context.Context, network string, source netip.AddrPort, destination netip.AddrPort) (*process.Info, error) {
|
||||||
|
return nil, os.ErrInvalid
|
||||||
|
}
|
||||||
|
|
||||||
|
type interfaceMonitorStub struct{}
|
||||||
|
|
||||||
|
func (s *interfaceMonitorStub) Start() error {
|
||||||
|
return os.ErrInvalid
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *interfaceMonitorStub) Close() error {
|
||||||
|
return os.ErrInvalid
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *interfaceMonitorStub) DefaultInterfaceName(destination netip.Addr) string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *interfaceMonitorStub) DefaultInterfaceIndex(destination netip.Addr) int {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *interfaceMonitorStub) DefaultInterface(destination netip.Addr) (string, int) {
|
||||||
|
return "", -1
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *interfaceMonitorStub) OverrideAndroidVPN() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *interfaceMonitorStub) AndroidVPNEnabled() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *interfaceMonitorStub) RegisterCallback(callback tun.DefaultInterfaceUpdateCallback) *list.Element[tun.DefaultInterfaceUpdateCallback] {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *interfaceMonitorStub) UnregisterCallback(element *list.Element[tun.DefaultInterfaceUpdateCallback]) {
|
||||||
|
}
|
||||||
|
|
||||||
func FormatConfig(configContent string) (string, error) {
|
func FormatConfig(configContent string) (string, error) {
|
||||||
options, err := parseConfig(configContent)
|
options, err := parseConfig(configContent)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
"github.com/sagernet/sing-tun"
|
"github.com/sagernet/sing-tun"
|
||||||
"github.com/sagernet/sing/common"
|
"github.com/sagernet/sing/common"
|
||||||
E "github.com/sagernet/sing/common/exceptions"
|
E "github.com/sagernet/sing/common/exceptions"
|
||||||
M "github.com/sagernet/sing/common/metadata"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type TunOptions interface {
|
type TunOptions interface {
|
||||||
@@ -20,6 +19,10 @@ type TunOptions interface {
|
|||||||
GetStrictRoute() bool
|
GetStrictRoute() bool
|
||||||
GetInet4RouteAddress() RoutePrefixIterator
|
GetInet4RouteAddress() RoutePrefixIterator
|
||||||
GetInet6RouteAddress() RoutePrefixIterator
|
GetInet6RouteAddress() RoutePrefixIterator
|
||||||
|
GetInet4RouteExcludeAddress() RoutePrefixIterator
|
||||||
|
GetInet6RouteExcludeAddress() RoutePrefixIterator
|
||||||
|
GetInet4RouteRange() RoutePrefixIterator
|
||||||
|
GetInet6RouteRange() RoutePrefixIterator
|
||||||
GetIncludePackage() StringIterator
|
GetIncludePackage() StringIterator
|
||||||
GetExcludePackage() StringIterator
|
GetExcludePackage() StringIterator
|
||||||
IsHTTPProxyEnabled() bool
|
IsHTTPProxyEnabled() bool
|
||||||
@@ -28,18 +31,30 @@ type TunOptions interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type RoutePrefix struct {
|
type RoutePrefix struct {
|
||||||
Address string
|
address netip.Addr
|
||||||
Prefix int32
|
prefix int
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *RoutePrefix) Address() string {
|
||||||
|
return p.address.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *RoutePrefix) Prefix() int32 {
|
||||||
|
return int32(p.prefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *RoutePrefix) Mask() string {
|
func (p *RoutePrefix) Mask() string {
|
||||||
var bits int
|
var bits int
|
||||||
if M.ParseSocksaddr(p.Address).Addr.Is6() {
|
if p.address.Is6() {
|
||||||
bits = 128
|
bits = 128
|
||||||
} else {
|
} else {
|
||||||
bits = 32
|
bits = 32
|
||||||
}
|
}
|
||||||
return net.IP(net.CIDRMask(int(p.Prefix), bits)).String()
|
return net.IP(net.CIDRMask(p.prefix, bits)).String()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *RoutePrefix) String() string {
|
||||||
|
return netip.PrefixFrom(p.address, p.prefix).String()
|
||||||
}
|
}
|
||||||
|
|
||||||
type RoutePrefixIterator interface {
|
type RoutePrefixIterator interface {
|
||||||
@@ -50,8 +65,8 @@ type RoutePrefixIterator interface {
|
|||||||
func mapRoutePrefix(prefixes []netip.Prefix) RoutePrefixIterator {
|
func mapRoutePrefix(prefixes []netip.Prefix) RoutePrefixIterator {
|
||||||
return newIterator(common.Map(prefixes, func(prefix netip.Prefix) *RoutePrefix {
|
return newIterator(common.Map(prefixes, func(prefix netip.Prefix) *RoutePrefix {
|
||||||
return &RoutePrefix{
|
return &RoutePrefix{
|
||||||
Address: prefix.Addr().String(),
|
address: prefix.Addr(),
|
||||||
Prefix: int32(prefix.Bits()),
|
prefix: prefix.Bits(),
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
@@ -92,12 +107,28 @@ func (o *tunOptions) GetStrictRoute() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *tunOptions) GetInet4RouteAddress() RoutePrefixIterator {
|
func (o *tunOptions) GetInet4RouteAddress() RoutePrefixIterator {
|
||||||
|
return mapRoutePrefix(o.Inet4RouteAddress)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *tunOptions) GetInet6RouteAddress() RoutePrefixIterator {
|
||||||
|
return mapRoutePrefix(o.Inet6RouteAddress)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *tunOptions) GetInet4RouteExcludeAddress() RoutePrefixIterator {
|
||||||
|
return mapRoutePrefix(o.Inet4RouteExcludeAddress)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *tunOptions) GetInet6RouteExcludeAddress() RoutePrefixIterator {
|
||||||
|
return mapRoutePrefix(o.Inet6RouteExcludeAddress)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *tunOptions) GetInet4RouteRange() RoutePrefixIterator {
|
||||||
return mapRoutePrefix(common.Filter(o.routeRanges, func(it netip.Prefix) bool {
|
return mapRoutePrefix(common.Filter(o.routeRanges, func(it netip.Prefix) bool {
|
||||||
return it.Addr().Is4()
|
return it.Addr().Is4()
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *tunOptions) GetInet6RouteAddress() RoutePrefixIterator {
|
func (o *tunOptions) GetInet6RouteRange() RoutePrefixIterator {
|
||||||
return mapRoutePrefix(common.Filter(o.routeRanges, func(it netip.Prefix) bool {
|
return mapRoutePrefix(common.Filter(o.routeRanges, func(it netip.Prefix) bool {
|
||||||
return it.Addr().Is6()
|
return it.Addr().Is6()
|
||||||
}))
|
}))
|
||||||
|
|||||||
16
go.mod
16
go.mod
@@ -26,14 +26,14 @@ require (
|
|||||||
github.com/sagernet/gvisor v0.0.0-20231119034329-07cfb6aaf930
|
github.com/sagernet/gvisor v0.0.0-20231119034329-07cfb6aaf930
|
||||||
github.com/sagernet/quic-go v0.40.0
|
github.com/sagernet/quic-go v0.40.0
|
||||||
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691
|
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691
|
||||||
github.com/sagernet/sing v0.2.19-0.20231208031707-0830d1517da8
|
github.com/sagernet/sing v0.2.20
|
||||||
github.com/sagernet/sing-dns v0.1.11
|
github.com/sagernet/sing-dns v0.1.12
|
||||||
github.com/sagernet/sing-mux v0.1.5
|
github.com/sagernet/sing-mux v0.1.6
|
||||||
github.com/sagernet/sing-quic v0.1.5
|
github.com/sagernet/sing-quic v0.1.6
|
||||||
github.com/sagernet/sing-shadowsocks v0.2.5
|
github.com/sagernet/sing-shadowsocks v0.2.6
|
||||||
github.com/sagernet/sing-shadowsocks2 v0.1.5
|
github.com/sagernet/sing-shadowsocks2 v0.1.5
|
||||||
github.com/sagernet/sing-shadowtls v0.1.4
|
github.com/sagernet/sing-shadowtls v0.1.4
|
||||||
github.com/sagernet/sing-tun v0.1.22
|
github.com/sagernet/sing-tun v0.1.24
|
||||||
github.com/sagernet/sing-vmess v0.1.8
|
github.com/sagernet/sing-vmess v0.1.8
|
||||||
github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37
|
github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37
|
||||||
github.com/sagernet/tfo-go v0.0.0-20230816093905-5a5c285d44a6
|
github.com/sagernet/tfo-go v0.0.0-20230816093905-5a5c285d44a6
|
||||||
@@ -44,7 +44,7 @@ require (
|
|||||||
github.com/stretchr/testify v1.8.4
|
github.com/stretchr/testify v1.8.4
|
||||||
go.uber.org/zap v1.26.0
|
go.uber.org/zap v1.26.0
|
||||||
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba
|
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba
|
||||||
golang.org/x/crypto v0.16.0
|
golang.org/x/crypto v0.17.0
|
||||||
golang.org/x/net v0.19.0
|
golang.org/x/net v0.19.0
|
||||||
golang.org/x/sys v0.15.0
|
golang.org/x/sys v0.15.0
|
||||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6
|
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6
|
||||||
@@ -86,7 +86,7 @@ require (
|
|||||||
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 // indirect
|
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 // indirect
|
||||||
github.com/zeebo/blake3 v0.2.3 // indirect
|
github.com/zeebo/blake3 v0.2.3 // indirect
|
||||||
go.uber.org/multierr v1.11.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20231127185646-65229373498e // indirect
|
golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect
|
||||||
golang.org/x/mod v0.14.0 // indirect
|
golang.org/x/mod v0.14.0 // indirect
|
||||||
golang.org/x/text v0.14.0 // indirect
|
golang.org/x/text v0.14.0 // indirect
|
||||||
golang.org/x/time v0.4.0 // indirect
|
golang.org/x/time v0.4.0 // indirect
|
||||||
|
|||||||
32
go.sum
32
go.sum
@@ -110,22 +110,22 @@ github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 h1:5Th31OC6yj8byL
|
|||||||
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU=
|
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU=
|
||||||
github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY=
|
github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY=
|
||||||
github.com/sagernet/sing v0.1.8/go.mod h1:jt1w2u7lJQFFSGLiRrRIs5YWmx4kAPfWuOejuDW9qMk=
|
github.com/sagernet/sing v0.1.8/go.mod h1:jt1w2u7lJQFFSGLiRrRIs5YWmx4kAPfWuOejuDW9qMk=
|
||||||
github.com/sagernet/sing v0.2.19-0.20231208031707-0830d1517da8 h1:w9gxEZISgkLf1VCySAu4ao7Ptgbkjl3t5JosaDAhqRE=
|
github.com/sagernet/sing v0.2.20 h1:ckcCB/5xu8G8wElNeH74IF6Soac5xWN+eQUXRuonjPQ=
|
||||||
github.com/sagernet/sing v0.2.19-0.20231208031707-0830d1517da8/go.mod h1:Ce5LNojQOgOiWhiD8pPD6E9H7e2KgtOe3Zxx4Ou5u80=
|
github.com/sagernet/sing v0.2.20/go.mod h1:Ce5LNojQOgOiWhiD8pPD6E9H7e2KgtOe3Zxx4Ou5u80=
|
||||||
github.com/sagernet/sing-dns v0.1.11 h1:PPrMCVVrAeR3f5X23I+cmvacXJ+kzuyAsBiWyUKhGSE=
|
github.com/sagernet/sing-dns v0.1.12 h1:1HqZ+ln+Rezx/aJMStaS0d7oPeX2EobSV1NT537kyj4=
|
||||||
github.com/sagernet/sing-dns v0.1.11/go.mod h1:zJ/YjnYB61SYE+ubMcMqVdpaSvsyQ2iShQGO3vuLvvE=
|
github.com/sagernet/sing-dns v0.1.12/go.mod h1:rx/DTOisneQpCgNQ4jbFU/JNEtnz0lYcHXenlVzpjEU=
|
||||||
github.com/sagernet/sing-mux v0.1.5 h1:jUbYth9QQd1wsDmU8Ush+fKce7lNo9TMv2dp8PJtSOY=
|
github.com/sagernet/sing-mux v0.1.6 h1:9+LsHgrtG/hgKpJOhtGcEFPeWHXaWeJDO3x4DeDQk5g=
|
||||||
github.com/sagernet/sing-mux v0.1.5/go.mod h1:MoH6Soz1R+CYZcCeIXZWx6fkZa6hQc9o3HZu9G6CDTw=
|
github.com/sagernet/sing-mux v0.1.6/go.mod h1:UmcVSPrVjsOGe95jDXmGgOyKKIXOcjz6FKbFy+0LeDU=
|
||||||
github.com/sagernet/sing-quic v0.1.5 h1:PIQzE4cGrry+JkkMEJH/EH3wRkv/QgD48+ScNr/2oig=
|
github.com/sagernet/sing-quic v0.1.6 h1:yNkZiNOlmEGpS+A7I4/Zavhe/fRrLz7yCO/dVMZzt+k=
|
||||||
github.com/sagernet/sing-quic v0.1.5/go.mod h1:n2mXukpubasyV4SlWyyW0+LCdAn7DZ8/brAkUxZujrw=
|
github.com/sagernet/sing-quic v0.1.6/go.mod h1:g1Ogcy2KSwKvC7eDXEUu9AnHbjotC+2xsSP+A1i/VOA=
|
||||||
github.com/sagernet/sing-shadowsocks v0.2.5 h1:qxIttos4xu6ii7MTVJYA8EFQR7Q3KG6xMqmLJIFtBaY=
|
github.com/sagernet/sing-shadowsocks v0.2.6 h1:xr7ylAS/q1cQYS8oxKKajhuQcchd5VJJ4K4UZrrpp0s=
|
||||||
github.com/sagernet/sing-shadowsocks v0.2.5/go.mod h1:MGWGkcU2xW2G2mfArT9/QqpVLOGU+dBaahZCtPHdt7A=
|
github.com/sagernet/sing-shadowsocks v0.2.6/go.mod h1:j2YZBIpWIuElPFL/5sJAj470bcn/3QQ5lxZUNKLDNAM=
|
||||||
github.com/sagernet/sing-shadowsocks2 v0.1.5 h1:JDeAJ4ZWlYZ7F6qEVdDKPhQEangxKw/JtmU+i/YfCYE=
|
github.com/sagernet/sing-shadowsocks2 v0.1.5 h1:JDeAJ4ZWlYZ7F6qEVdDKPhQEangxKw/JtmU+i/YfCYE=
|
||||||
github.com/sagernet/sing-shadowsocks2 v0.1.5/go.mod h1:KF65y8lI5PGHyMgRZGYXYsH9ilgRc/yr+NYbSNGuBm4=
|
github.com/sagernet/sing-shadowsocks2 v0.1.5/go.mod h1:KF65y8lI5PGHyMgRZGYXYsH9ilgRc/yr+NYbSNGuBm4=
|
||||||
github.com/sagernet/sing-shadowtls v0.1.4 h1:aTgBSJEgnumzFenPvc+kbD9/W0PywzWevnVpEx6Tw3k=
|
github.com/sagernet/sing-shadowtls v0.1.4 h1:aTgBSJEgnumzFenPvc+kbD9/W0PywzWevnVpEx6Tw3k=
|
||||||
github.com/sagernet/sing-shadowtls v0.1.4/go.mod h1:F8NBgsY5YN2beQavdgdm1DPlhaKQlaL6lpDdcBglGK4=
|
github.com/sagernet/sing-shadowtls v0.1.4/go.mod h1:F8NBgsY5YN2beQavdgdm1DPlhaKQlaL6lpDdcBglGK4=
|
||||||
github.com/sagernet/sing-tun v0.1.22 h1:AECJTkiugCK+GCrV41YZ56HB/Z/lDXZvRVas4fNvO30=
|
github.com/sagernet/sing-tun v0.1.24 h1:cxn8lr8uHMLB1tLU0SzBPE1Q04pG0Fb71GyeeCuic5Q=
|
||||||
github.com/sagernet/sing-tun v0.1.22/go.mod h1:fliIEXDRv2u1uT3uCZIoA1daoZcD4f6TeIuzNIzlsN8=
|
github.com/sagernet/sing-tun v0.1.24/go.mod h1:Mnd7+8iGNb9uGnMAh3bp0ZA+nPFBZNaMHZPMEGdAQJM=
|
||||||
github.com/sagernet/sing-vmess v0.1.8 h1:XVWad1RpTy9b5tPxdm5MCU8cGfrTGdR8qCq6HV2aCNc=
|
github.com/sagernet/sing-vmess v0.1.8 h1:XVWad1RpTy9b5tPxdm5MCU8cGfrTGdR8qCq6HV2aCNc=
|
||||||
github.com/sagernet/sing-vmess v0.1.8/go.mod h1:vhx32UNzTDUkNwOyIjcZQohre1CaytquC5mPplId8uA=
|
github.com/sagernet/sing-vmess v0.1.8/go.mod h1:vhx32UNzTDUkNwOyIjcZQohre1CaytquC5mPplId8uA=
|
||||||
github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37 h1:HuE6xSwco/Xed8ajZ+coeYLmioq0Qp1/Z2zczFaV8as=
|
github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37 h1:HuE6xSwco/Xed8ajZ+coeYLmioq0Qp1/Z2zczFaV8as=
|
||||||
@@ -169,10 +169,10 @@ go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBs
|
|||||||
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
|
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
|
||||||
golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
|
golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
|
||||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
||||||
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
|
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
|
||||||
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||||
golang.org/x/exp v0.0.0-20231127185646-65229373498e h1:Gvh4YaCaXNs6dKTlfgismwWZKyjVZXwOPfIyUaqU3No=
|
golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE=
|
||||||
golang.org/x/exp v0.0.0-20231127185646-65229373498e/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
|
golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
|
||||||
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
|
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
|
||||||
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"net"
|
"net"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/adapter"
|
"github.com/sagernet/sing-box/adapter"
|
||||||
C "github.com/sagernet/sing-box/constant"
|
C "github.com/sagernet/sing-box/constant"
|
||||||
@@ -47,13 +48,13 @@ func NewDirect(ctx context.Context, router adapter.Router, logger log.ContextLog
|
|||||||
inbound.overrideOption = 3
|
inbound.overrideOption = 3
|
||||||
inbound.overrideDestination = M.Socksaddr{Port: options.OverridePort}
|
inbound.overrideDestination = M.Socksaddr{Port: options.OverridePort}
|
||||||
}
|
}
|
||||||
var udpTimeout int64
|
var udpTimeout time.Duration
|
||||||
if options.UDPTimeout != 0 {
|
if options.UDPTimeout != 0 {
|
||||||
udpTimeout = options.UDPTimeout
|
udpTimeout = time.Duration(options.UDPTimeout)
|
||||||
} else {
|
} else {
|
||||||
udpTimeout = int64(C.UDPTimeout.Seconds())
|
udpTimeout = C.UDPTimeout
|
||||||
}
|
}
|
||||||
inbound.udpNat = udpnat.New[netip.AddrPort](udpTimeout, adapter.NewUpstreamContextHandler(inbound.newConnection, inbound.newPacketConnection, inbound))
|
inbound.udpNat = udpnat.New[netip.AddrPort](int64(udpTimeout.Seconds()), adapter.NewUpstreamContextHandler(inbound.newConnection, inbound.newPacketConnection, inbound))
|
||||||
inbound.connHandler = inbound
|
inbound.connHandler = inbound
|
||||||
inbound.packetHandler = inbound
|
inbound.packetHandler = inbound
|
||||||
inbound.packetUpstream = inbound.udpNat
|
inbound.packetUpstream = inbound.udpNat
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package inbound
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net"
|
"net"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/adapter"
|
"github.com/sagernet/sing-box/adapter"
|
||||||
"github.com/sagernet/sing-box/common/humanize"
|
"github.com/sagernet/sing-box/common/humanize"
|
||||||
@@ -66,6 +67,12 @@ func NewHysteria(ctx context.Context, router adapter.Router, logger log.ContextL
|
|||||||
} else {
|
} else {
|
||||||
receiveBps = uint64(options.DownMbps) * hysteria.MbpsToBps
|
receiveBps = uint64(options.DownMbps) * hysteria.MbpsToBps
|
||||||
}
|
}
|
||||||
|
var udpTimeout time.Duration
|
||||||
|
if options.UDPTimeout != 0 {
|
||||||
|
udpTimeout = time.Duration(options.UDPTimeout)
|
||||||
|
} else {
|
||||||
|
udpTimeout = C.UDPTimeout
|
||||||
|
}
|
||||||
service, err := hysteria.NewService[int](hysteria.ServiceOptions{
|
service, err := hysteria.NewService[int](hysteria.ServiceOptions{
|
||||||
Context: ctx,
|
Context: ctx,
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
@@ -73,6 +80,7 @@ func NewHysteria(ctx context.Context, router adapter.Router, logger log.ContextL
|
|||||||
ReceiveBPS: receiveBps,
|
ReceiveBPS: receiveBps,
|
||||||
XPlusPassword: options.Obfs,
|
XPlusPassword: options.Obfs,
|
||||||
TLSConfig: tlsConfig,
|
TLSConfig: tlsConfig,
|
||||||
|
UDPTimeout: udpTimeout,
|
||||||
Handler: adapter.NewUpstreamHandler(adapter.InboundContext{}, inbound.newConnection, inbound.newPacketConnection, nil),
|
Handler: adapter.NewUpstreamHandler(adapter.InboundContext{}, inbound.newConnection, inbound.newPacketConnection, nil),
|
||||||
|
|
||||||
// Legacy options
|
// Legacy options
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httputil"
|
"net/http/httputil"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/adapter"
|
"github.com/sagernet/sing-box/adapter"
|
||||||
"github.com/sagernet/sing-box/common/tls"
|
"github.com/sagernet/sing-box/common/tls"
|
||||||
@@ -87,6 +88,12 @@ func NewHysteria2(ctx context.Context, router adapter.Router, logger log.Context
|
|||||||
},
|
},
|
||||||
tlsConfig: tlsConfig,
|
tlsConfig: tlsConfig,
|
||||||
}
|
}
|
||||||
|
var udpTimeout time.Duration
|
||||||
|
if options.UDPTimeout != 0 {
|
||||||
|
udpTimeout = time.Duration(options.UDPTimeout)
|
||||||
|
} else {
|
||||||
|
udpTimeout = C.UDPTimeout
|
||||||
|
}
|
||||||
service, err := hysteria2.NewService[int](hysteria2.ServiceOptions{
|
service, err := hysteria2.NewService[int](hysteria2.ServiceOptions{
|
||||||
Context: ctx,
|
Context: ctx,
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
@@ -96,6 +103,7 @@ func NewHysteria2(ctx context.Context, router adapter.Router, logger log.Context
|
|||||||
SalamanderPassword: salamanderPassword,
|
SalamanderPassword: salamanderPassword,
|
||||||
TLSConfig: tlsConfig,
|
TLSConfig: tlsConfig,
|
||||||
IgnoreClientBandwidth: options.IgnoreClientBandwidth,
|
IgnoreClientBandwidth: options.IgnoreClientBandwidth,
|
||||||
|
UDPTimeout: udpTimeout,
|
||||||
Handler: adapter.NewUpstreamHandler(adapter.InboundContext{}, inbound.newConnection, inbound.newPacketConnection, nil),
|
Handler: adapter.NewUpstreamHandler(adapter.InboundContext{}, inbound.newConnection, inbound.newPacketConnection, nil),
|
||||||
MasqueradeHandler: masqueradeHandler,
|
MasqueradeHandler: masqueradeHandler,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/adapter"
|
"github.com/sagernet/sing-box/adapter"
|
||||||
"github.com/sagernet/sing-box/common/mux"
|
"github.com/sagernet/sing-box/common/mux"
|
||||||
@@ -65,19 +66,19 @@ func newShadowsocks(ctx context.Context, router adapter.Router, logger log.Conte
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var udpTimeout int64
|
var udpTimeout time.Duration
|
||||||
if options.UDPTimeout != 0 {
|
if options.UDPTimeout != 0 {
|
||||||
udpTimeout = options.UDPTimeout
|
udpTimeout = time.Duration(options.UDPTimeout)
|
||||||
} else {
|
} else {
|
||||||
udpTimeout = int64(C.UDPTimeout.Seconds())
|
udpTimeout = C.UDPTimeout
|
||||||
}
|
}
|
||||||
switch {
|
switch {
|
||||||
case options.Method == shadowsocks.MethodNone:
|
case options.Method == shadowsocks.MethodNone:
|
||||||
inbound.service = shadowsocks.NewNoneService(options.UDPTimeout, inbound.upstreamContextHandler())
|
inbound.service = shadowsocks.NewNoneService(int64(udpTimeout.Seconds()), inbound.upstreamContextHandler())
|
||||||
case common.Contains(shadowaead.List, options.Method):
|
case common.Contains(shadowaead.List, options.Method):
|
||||||
inbound.service, err = shadowaead.NewService(options.Method, nil, options.Password, udpTimeout, inbound.upstreamContextHandler())
|
inbound.service, err = shadowaead.NewService(options.Method, nil, options.Password, int64(udpTimeout.Seconds()), inbound.upstreamContextHandler())
|
||||||
case common.Contains(shadowaead_2022.List, options.Method):
|
case common.Contains(shadowaead_2022.List, options.Method):
|
||||||
inbound.service, err = shadowaead_2022.NewServiceWithPassword(options.Method, options.Password, udpTimeout, inbound.upstreamContextHandler(), ntp.TimeFuncFromContext(ctx))
|
inbound.service, err = shadowaead_2022.NewServiceWithPassword(options.Method, options.Password, int64(udpTimeout.Seconds()), inbound.upstreamContextHandler(), ntp.TimeFuncFromContext(ctx))
|
||||||
default:
|
default:
|
||||||
err = E.New("unsupported method: ", options.Method)
|
err = E.New("unsupported method: ", options.Method)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/adapter"
|
"github.com/sagernet/sing-box/adapter"
|
||||||
"github.com/sagernet/sing-box/common/mux"
|
"github.com/sagernet/sing-box/common/mux"
|
||||||
@@ -53,25 +54,25 @@ func newShadowsocksMulti(ctx context.Context, router adapter.Router, logger log.
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var udpTimeout int64
|
var udpTimeout time.Duration
|
||||||
if options.UDPTimeout != 0 {
|
if options.UDPTimeout != 0 {
|
||||||
udpTimeout = options.UDPTimeout
|
udpTimeout = time.Duration(options.UDPTimeout)
|
||||||
} else {
|
} else {
|
||||||
udpTimeout = int64(C.UDPTimeout.Seconds())
|
udpTimeout = C.UDPTimeout
|
||||||
}
|
}
|
||||||
var service shadowsocks.MultiService[int]
|
var service shadowsocks.MultiService[int]
|
||||||
if common.Contains(shadowaead_2022.List, options.Method) {
|
if common.Contains(shadowaead_2022.List, options.Method) {
|
||||||
service, err = shadowaead_2022.NewMultiServiceWithPassword[int](
|
service, err = shadowaead_2022.NewMultiServiceWithPassword[int](
|
||||||
options.Method,
|
options.Method,
|
||||||
options.Password,
|
options.Password,
|
||||||
udpTimeout,
|
int64(udpTimeout.Seconds()),
|
||||||
adapter.NewUpstreamContextHandler(inbound.newConnection, inbound.newPacketConnection, inbound),
|
adapter.NewUpstreamContextHandler(inbound.newConnection, inbound.newPacketConnection, inbound),
|
||||||
ntp.TimeFuncFromContext(ctx),
|
ntp.TimeFuncFromContext(ctx),
|
||||||
)
|
)
|
||||||
} else if common.Contains(shadowaead.List, options.Method) {
|
} else if common.Contains(shadowaead.List, options.Method) {
|
||||||
service, err = shadowaead.NewMultiService[int](
|
service, err = shadowaead.NewMultiService[int](
|
||||||
options.Method,
|
options.Method,
|
||||||
udpTimeout,
|
int64(udpTimeout.Seconds()),
|
||||||
adapter.NewUpstreamContextHandler(inbound.newConnection, inbound.newPacketConnection, inbound))
|
adapter.NewUpstreamContextHandler(inbound.newConnection, inbound.newPacketConnection, inbound))
|
||||||
} else {
|
} else {
|
||||||
return nil, E.New("unsupported method: " + options.Method)
|
return nil, E.New("unsupported method: " + options.Method)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/adapter"
|
"github.com/sagernet/sing-box/adapter"
|
||||||
"github.com/sagernet/sing-box/common/mux"
|
"github.com/sagernet/sing-box/common/mux"
|
||||||
@@ -50,16 +51,16 @@ func newShadowsocksRelay(ctx context.Context, router adapter.Router, logger log.
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var udpTimeout int64
|
var udpTimeout time.Duration
|
||||||
if options.UDPTimeout != 0 {
|
if options.UDPTimeout != 0 {
|
||||||
udpTimeout = options.UDPTimeout
|
udpTimeout = time.Duration(options.UDPTimeout)
|
||||||
} else {
|
} else {
|
||||||
udpTimeout = int64(C.UDPTimeout.Seconds())
|
udpTimeout = C.UDPTimeout
|
||||||
}
|
}
|
||||||
service, err := shadowaead_2022.NewRelayServiceWithPassword[int](
|
service, err := shadowaead_2022.NewRelayServiceWithPassword[int](
|
||||||
options.Method,
|
options.Method,
|
||||||
options.Password,
|
options.Password,
|
||||||
udpTimeout,
|
int64(udpTimeout.Seconds()),
|
||||||
adapter.NewUpstreamContextHandler(inbound.newConnection, inbound.newPacketConnection, inbound),
|
adapter.NewUpstreamContextHandler(inbound.newConnection, inbound.newPacketConnection, inbound),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/adapter"
|
"github.com/sagernet/sing-box/adapter"
|
||||||
"github.com/sagernet/sing-box/common/redir"
|
"github.com/sagernet/sing-box/common/redir"
|
||||||
@@ -37,15 +38,15 @@ func NewTProxy(ctx context.Context, router adapter.Router, logger log.ContextLog
|
|||||||
listenOptions: options.ListenOptions,
|
listenOptions: options.ListenOptions,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
var udpTimeout int64
|
var udpTimeout time.Duration
|
||||||
if options.UDPTimeout != 0 {
|
if options.UDPTimeout != 0 {
|
||||||
udpTimeout = options.UDPTimeout
|
udpTimeout = time.Duration(options.UDPTimeout)
|
||||||
} else {
|
} else {
|
||||||
udpTimeout = int64(C.UDPTimeout.Seconds())
|
udpTimeout = C.UDPTimeout
|
||||||
}
|
}
|
||||||
tproxy.connHandler = tproxy
|
tproxy.connHandler = tproxy
|
||||||
tproxy.oobPacketHandler = tproxy
|
tproxy.oobPacketHandler = tproxy
|
||||||
tproxy.udpNat = udpnat.New[netip.AddrPort](udpTimeout, tproxy.upstreamContextHandler())
|
tproxy.udpNat = udpnat.New[netip.AddrPort](int64(udpTimeout.Seconds()), tproxy.upstreamContextHandler())
|
||||||
tproxy.packetUpstream = tproxy.udpNat
|
tproxy.packetUpstream = tproxy.udpNat
|
||||||
return tproxy
|
return tproxy
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,12 @@ func NewTUIC(ctx context.Context, router adapter.Router, logger log.ContextLogge
|
|||||||
},
|
},
|
||||||
tlsConfig: tlsConfig,
|
tlsConfig: tlsConfig,
|
||||||
}
|
}
|
||||||
|
var udpTimeout time.Duration
|
||||||
|
if options.UDPTimeout != 0 {
|
||||||
|
udpTimeout = time.Duration(options.UDPTimeout)
|
||||||
|
} else {
|
||||||
|
udpTimeout = C.UDPTimeout
|
||||||
|
}
|
||||||
service, err := tuic.NewService[int](tuic.ServiceOptions{
|
service, err := tuic.NewService[int](tuic.ServiceOptions{
|
||||||
Context: ctx,
|
Context: ctx,
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
@@ -60,6 +66,7 @@ func NewTUIC(ctx context.Context, router adapter.Router, logger log.ContextLogge
|
|||||||
AuthTimeout: time.Duration(options.AuthTimeout),
|
AuthTimeout: time.Duration(options.AuthTimeout),
|
||||||
ZeroRTTHandshake: options.ZeroRTTHandshake,
|
ZeroRTTHandshake: options.ZeroRTTHandshake,
|
||||||
Heartbeat: time.Duration(options.Heartbeat),
|
Heartbeat: time.Duration(options.Heartbeat),
|
||||||
|
UDPTimeout: udpTimeout,
|
||||||
Handler: adapter.NewUpstreamHandler(adapter.InboundContext{}, inbound.newConnection, inbound.newPacketConnection, nil),
|
Handler: adapter.NewUpstreamHandler(adapter.InboundContext{}, inbound.newConnection, inbound.newPacketConnection, nil),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/adapter"
|
"github.com/sagernet/sing-box/adapter"
|
||||||
C "github.com/sagernet/sing-box/constant"
|
C "github.com/sagernet/sing-box/constant"
|
||||||
@@ -42,11 +43,11 @@ func NewTun(ctx context.Context, router adapter.Router, logger log.ContextLogger
|
|||||||
if tunMTU == 0 {
|
if tunMTU == 0 {
|
||||||
tunMTU = 9000
|
tunMTU = 9000
|
||||||
}
|
}
|
||||||
var udpTimeout int64
|
var udpTimeout time.Duration
|
||||||
if options.UDPTimeout != 0 {
|
if options.UDPTimeout != 0 {
|
||||||
udpTimeout = options.UDPTimeout
|
udpTimeout = time.Duration(options.UDPTimeout)
|
||||||
} else {
|
} else {
|
||||||
udpTimeout = int64(C.UDPTimeout.Seconds())
|
udpTimeout = C.UDPTimeout
|
||||||
}
|
}
|
||||||
includeUID := uidToRange(options.IncludeUID)
|
includeUID := uidToRange(options.IncludeUID)
|
||||||
if len(options.IncludeUIDRange) > 0 {
|
if len(options.IncludeUIDRange) > 0 {
|
||||||
@@ -92,7 +93,7 @@ func NewTun(ctx context.Context, router adapter.Router, logger log.ContextLogger
|
|||||||
TableIndex: 2022,
|
TableIndex: 2022,
|
||||||
},
|
},
|
||||||
endpointIndependentNat: options.EndpointIndependentNat,
|
endpointIndependentNat: options.EndpointIndependentNat,
|
||||||
udpTimeout: udpTimeout,
|
udpTimeout: int64(udpTimeout.Seconds()),
|
||||||
stack: options.Stack,
|
stack: options.Stack,
|
||||||
platformInterface: platformInterface,
|
platformInterface: platformInterface,
|
||||||
platformOptions: common.PtrValueOrDefault(options.Platform),
|
platformOptions: common.PtrValueOrDefault(options.Platform),
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package option
|
package option
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/common/json"
|
"github.com/sagernet/sing-box/common/json"
|
||||||
C "github.com/sagernet/sing-box/constant"
|
C "github.com/sagernet/sing-box/constant"
|
||||||
E "github.com/sagernet/sing/common/exceptions"
|
E "github.com/sagernet/sing/common/exceptions"
|
||||||
@@ -128,15 +130,27 @@ type InboundOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ListenOptions struct {
|
type ListenOptions struct {
|
||||||
Listen *ListenAddress `json:"listen,omitempty"`
|
Listen *ListenAddress `json:"listen,omitempty"`
|
||||||
ListenPort uint16 `json:"listen_port,omitempty"`
|
ListenPort uint16 `json:"listen_port,omitempty"`
|
||||||
TCPFastOpen bool `json:"tcp_fast_open,omitempty"`
|
TCPFastOpen bool `json:"tcp_fast_open,omitempty"`
|
||||||
TCPMultiPath bool `json:"tcp_multi_path,omitempty"`
|
TCPMultiPath bool `json:"tcp_multi_path,omitempty"`
|
||||||
UDPFragment *bool `json:"udp_fragment,omitempty"`
|
UDPFragment *bool `json:"udp_fragment,omitempty"`
|
||||||
UDPFragmentDefault bool `json:"-"`
|
UDPFragmentDefault bool `json:"-"`
|
||||||
UDPTimeout int64 `json:"udp_timeout,omitempty"`
|
UDPTimeout UDPTimeoutCompat `json:"udp_timeout,omitempty"`
|
||||||
ProxyProtocol bool `json:"proxy_protocol,omitempty"`
|
ProxyProtocol bool `json:"proxy_protocol,omitempty"`
|
||||||
ProxyProtocolAcceptNoHeader bool `json:"proxy_protocol_accept_no_header,omitempty"`
|
ProxyProtocolAcceptNoHeader bool `json:"proxy_protocol_accept_no_header,omitempty"`
|
||||||
Detour string `json:"detour,omitempty"`
|
Detour string `json:"detour,omitempty"`
|
||||||
InboundOptions
|
InboundOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type UDPTimeoutCompat Duration
|
||||||
|
|
||||||
|
func (u *UDPTimeoutCompat) UnmarshalJSON(data []byte) error {
|
||||||
|
var valueNumber int64
|
||||||
|
err := json.Unmarshal(data, &valueNumber)
|
||||||
|
if err == nil {
|
||||||
|
*u = UDPTimeoutCompat(time.Second * time.Duration(valueNumber))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return json.Unmarshal(data, (*Duration)(u))
|
||||||
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ type TunInboundOptions struct {
|
|||||||
IncludePackage Listable[string] `json:"include_package,omitempty"`
|
IncludePackage Listable[string] `json:"include_package,omitempty"`
|
||||||
ExcludePackage Listable[string] `json:"exclude_package,omitempty"`
|
ExcludePackage Listable[string] `json:"exclude_package,omitempty"`
|
||||||
EndpointIndependentNat bool `json:"endpoint_independent_nat,omitempty"`
|
EndpointIndependentNat bool `json:"endpoint_independent_nat,omitempty"`
|
||||||
UDPTimeout int64 `json:"udp_timeout,omitempty"`
|
UDPTimeout UDPTimeoutCompat `json:"udp_timeout,omitempty"`
|
||||||
Stack string `json:"stack,omitempty"`
|
Stack string `json:"stack,omitempty"`
|
||||||
Platform *TunPlatformOptions `json:"platform,omitempty"`
|
Platform *TunPlatformOptions `json:"platform,omitempty"`
|
||||||
InboundOptions
|
InboundOptions
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import (
|
|||||||
"github.com/sagernet/sing-box/log"
|
"github.com/sagernet/sing-box/log"
|
||||||
"github.com/sagernet/sing-box/option"
|
"github.com/sagernet/sing-box/option"
|
||||||
"github.com/sagernet/sing-dns"
|
"github.com/sagernet/sing-dns"
|
||||||
"github.com/sagernet/sing/common/buf"
|
|
||||||
"github.com/sagernet/sing/common/bufio"
|
"github.com/sagernet/sing/common/bufio"
|
||||||
E "github.com/sagernet/sing/common/exceptions"
|
E "github.com/sagernet/sing/common/exceptions"
|
||||||
M "github.com/sagernet/sing/common/metadata"
|
M "github.com/sagernet/sing/common/metadata"
|
||||||
@@ -123,6 +122,7 @@ func (h *Direct) ListenPacket(ctx context.Context, destination M.Socksaddr) (net
|
|||||||
ctx, metadata := adapter.ExtendContext(ctx)
|
ctx, metadata := adapter.ExtendContext(ctx)
|
||||||
metadata.Outbound = h.tag
|
metadata.Outbound = h.tag
|
||||||
metadata.Destination = destination
|
metadata.Destination = destination
|
||||||
|
originDestination := destination
|
||||||
switch h.overrideOption {
|
switch h.overrideOption {
|
||||||
case 1:
|
case 1:
|
||||||
destination = h.overrideDestination
|
destination = h.overrideDestination
|
||||||
@@ -142,11 +142,10 @@ func (h *Direct) ListenPacket(ctx context.Context, destination M.Socksaddr) (net
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if h.overrideOption == 0 {
|
if originDestination != destination {
|
||||||
return conn, nil
|
conn = bufio.NewNATPacketConn(bufio.NewPacketConn(conn), destination, originDestination)
|
||||||
} else {
|
|
||||||
return &overridePacketConn{bufio.NewPacketConn(conn), destination}, nil
|
|
||||||
}
|
}
|
||||||
|
return conn, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Direct) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error {
|
func (h *Direct) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error {
|
||||||
@@ -156,20 +155,3 @@ func (h *Direct) NewConnection(ctx context.Context, conn net.Conn, metadata adap
|
|||||||
func (h *Direct) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error {
|
func (h *Direct) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error {
|
||||||
return NewPacketConnection(ctx, h, conn, metadata)
|
return NewPacketConnection(ctx, h, conn, metadata)
|
||||||
}
|
}
|
||||||
|
|
||||||
type overridePacketConn struct {
|
|
||||||
N.NetPacketConn
|
|
||||||
overrideDestination M.Socksaddr
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *overridePacketConn) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error {
|
|
||||||
return c.NetPacketConn.WritePacket(buffer, c.overrideDestination)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *overridePacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error) {
|
|
||||||
return c.NetPacketConn.WriteTo(p, c.overrideDestination.UDPAddr())
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *overridePacketConn) Upstream() any {
|
|
||||||
return c.NetPacketConn
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user