Compare commits

..

63 Commits

Author SHA1 Message Date
世界
88fad9fdad documentation: Bump version 2024-01-01 16:21:56 +08:00
世界
d7ba184657 documentation: Update package managers 2024-01-01 16:21:44 +08:00
世界
7a6028f0e3 Remove unnecessary context wrappers 2024-01-01 16:21:44 +08:00
世界
ce52ce0ca1 Improve read wait interface &
Refactor Authenticator interface to struct &
Update smux &
Update gVisor to 20231204.0 &
Update quic-go to v0.40.1 &
Update wireguard-go &
Add GSO support for TUN/WireGuard &
Fix router pre-start &
Fix bind forwarder to interface for systems stack
2024-01-01 16:21:39 +08:00
世界
68f9ef47a6 Make generated files have SUDO_USER's permissions if possible. 2024-01-01 16:20:23 +08:00
世界
27e68df931 Refactor inbound/outbound options struct 2024-01-01 16:20:22 +08:00
世界
6c7c7a14e9 Improve configuration merge 2024-01-01 16:20:22 +08:00
世界
0aec78b2c4 Update uTLS to 1.5.4 2024-01-01 16:20:22 +08:00
世界
baa80a918c Update tfo-go 2024-01-01 16:20:22 +08:00
世界
8f3c59f340 Update gomobile and add tag 2024-01-01 16:20:21 +08:00
世界
57713be425 Update cloudflare-tls to go1.21.5 2024-01-01 16:20:21 +08:00
世界
778f0d35d5 Make type check strict 2024-01-01 16:20:21 +08:00
世界
41874babf7 Remove comparable limit for Listable 2024-01-01 16:20:21 +08:00
世界
ff6d867e11 Avoid opening log output before start &
Replace tracing logs with task monitor
2024-01-01 16:20:20 +08:00
世界
c6729cd8b3 Update documentation 2024-01-01 16:20:19 +08:00
世界
26b7568145 Add idle_timeout for URLTest outbound 2024-01-01 16:20:19 +08:00
世界
d8feebfcba Skip internal fake-ip queries 2024-01-01 16:20:18 +08:00
世界
dfc32d4591 Migrate contentjson and badjson to library &
Add omitempty in format
2024-01-01 16:20:18 +08:00
世界
c2602e437f Update documentation 2024-01-01 16:20:17 +08:00
世界
6deb50ce1f Independent source_ip_is_private and ip_is_private rules 2024-01-01 16:20:17 +08:00
世界
9d2808b2d1 Add rule-set 2024-01-01 16:20:17 +08:00
世界
2ef67c5f95 Update buffer usage 2024-01-01 16:20:16 +08:00
世界
d2423dc5fb Allow nested logical rules 2024-01-01 16:20:16 +08:00
世界
a70d0177fa Migrate to independent cache file 2024-01-01 16:20:16 +08:00
世界
c506255e0f Fix grpc lite transport encoding 2024-01-01 16:16:58 +08:00
世界
87c6fd4c0f Fix h2mux request context 2024-01-01 16:15:49 +08:00
世界
19c445d28e documentation: Bump version 2023-12-29 18:00:40 +08:00
世界
9119a5209b dcoumentation: Fix description of cipher_suites 2023-12-29 18:00:40 +08:00
世界
46c8d6e61f Fix pprof URL path 2023-12-29 18:00:40 +08:00
世界
ea17c2786d Update dependencies 2023-12-27 10:37:18 +08:00
世界
12ababd911 Fix mux test 2023-12-27 10:30:19 +08:00
世界
0523845833 Update issue reporting templates
Enhanced the issue reporting templates for both English and Chinese versions by adding more structured and comprehensive guideline checkboxes. This aims to ensure contributors provide sufficient and beneficial information for reproducing and resolving issues, thereby improving the quality of reports and making issue tracking more efficient.
2023-12-26 19:05:19 +08:00
renovate[bot]
57794919fa [dependencies] Update actions/upload-artifact action to v4 2023-12-26 19:04:51 +08:00
世界
f5bb5cf343 Fix missing marshal for udp_timeout 2023-12-26 10:52:46 +08:00
世界
3eed614dea Fix ACME ALPN conflict 2023-12-26 09:02:58 +08:00
世界
76a295a660 Fix missing nil check for URLTest 2023-12-26 09:02:58 +08:00
世界
082e3fb8df Fix V2Ray transport path validation behavior 2023-12-26 09:02:58 +08:00
世界
a0cab4f563 Fix websocket client initialize 2023-12-22 20:38:06 +08:00
世界
aeb7308e81 documentation: Bump version 2023-12-21 15:25:19 +08:00
世界
bb1ebfda83 documentation: Fix link format 2023-12-21 15:24:05 +08:00
世界
c05c798221 Fix missing UDP timeout for QUIC protocols 2023-12-21 15:16:36 +08:00
世界
55b1bcc6a5 Migrate udp_timeout from seconds to duration format 2023-12-21 14:50:33 +08:00
世界
d6eddce420 Fix missing handshake timeout for multiplex 2023-12-21 14:21:59 +08:00
世界
4bf057139b Fix DNS dial context 2023-12-21 14:19:27 +08:00
世界
a1b28b8282 Try to fix HTTP server leak again 2023-12-21 14:16:16 +08:00
世界
d0aaf71770 Fix direct UDP override 2023-12-18 21:48:59 +08:00
世界
2f31202c6b documentation: Update shadowsocks example
Remove the information on password generation for `2022-blake3-aes-128-gcm` cipher from the Server Example section in the shadowsocks.md file as it is no longer needed.
2023-12-14 21:05:41 +08:00
renovate[bot]
e4cc510712 [dependencies] Update github-actions 2023-12-14 15:14:22 +08:00
世界
e329bf6865 Update dependencies 2023-12-14 15:09:03 +08:00
世界
2badcec765 platform: Fix check config 2023-12-12 20:26:41 +08:00
世界
e71c13b1a2 documentation: Bump version 2023-12-12 13:54:23 +08:00
世界
a959a67ed3 FIx error handling for netlink banned in Android 2023-12-12 13:54:23 +08:00
世界
a1044af579 platform: Fix VPN route 2023-12-11 21:59:59 +08:00
世界
a64b57451a Update dependencies 2023-12-11 21:40:11 +08:00
世界
f0e2318cbd Fix auto-route IPv6 on darwin 2023-12-11 21:39:29 +08:00
世界
ebec308fd8 documentation: Bump version 2023-12-09 00:22:27 +08:00
世界
ca094587be Fix incorrect dependency 2023-12-09 00:22:27 +08:00
世界
ca3b86c781 Update bug report template 2023-12-08 21:56:30 +08:00
世界
5a1d0047b9 documentation: Bump version 2023-12-08 21:38:34 +08:00
世界
4669854039 Fix method check for v2ray HTTP transport 2023-12-08 21:12:52 +08:00
世界
2eecdc38a4 Fix gun conn setup 2023-12-08 21:10:36 +08:00
世界
83581b7c1a Update dependencies 2023-12-08 11:18:52 +08:00
世界
d346f0023d Fix HTTP connect client again 2023-12-08 11:18:52 +08:00
191 changed files with 2630 additions and 1768 deletions

View File

@@ -44,13 +44,7 @@ body:
attributes:
label: Version
description: If you are using the original command line program, please provide the output of the `sing-box version` command.
value: |-
<details>
```console
# Replace this line with the output
```
</details>
render: shell
- type: textarea
attributes:
label: Description
@@ -67,13 +61,22 @@ body:
attributes:
label: Logs
description: |-
If you encounter a crash with the graphical client, please provide crash logs.
In addition, if you encounter a crash with the graphical client, please also provide 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.
value: |-
<details>
```console
# Replace this line with logs
```
</details>
render: shell
- type: checkboxes
attributes:
label: Integrity requirements
description: |-
Please check all of the following options to prove that you have read and understood the requirements, otherwise this issue will be closed.
Sing-box is not a project aimed to please users who can't make any meaningful contributions and gain unethical influence. If you deceive here to deliberately waste the time of the developers, you will be permanently blocked.
options:
- label: I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
required: true
- label: I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
required: true
- label: I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
required: true
- label: I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.
required: true

View File

@@ -44,13 +44,7 @@ body:
attributes:
label: 版本
description: 如果您使用原始命令行程序,请提供 `sing-box version` 命令的输出。
value: |-
<details>
```console
# 使用输出内容覆盖此行
```
</details>
render: shell
- type: textarea
attributes:
label: 描述
@@ -67,13 +61,22 @@ body:
attributes:
label: 日志
description: |-
如果您遭遇图形界面应用程序崩溃,请提供崩溃日志。
此外,如果您遭遇图形界面应用程序崩溃,请附加提供崩溃日志。
对于 Apple 平台图形客户端程序,请检查 `Settings - View Service Log` 以导出崩溃日志。
对于 Android 图形客户端程序,请检查 `/sdcard/Android/data/io.nekohasekai.sfa/files/stderr.log` 文件以导出崩溃日志。
value: |-
<details>
```console
# 使用日志内容覆盖此行
```
</details>
render: shell
- type: checkboxes
attributes:
label: 完整性要求
description: |-
请勾选以下所有选项以证明您已经阅读并理解了以下要求,否则该 issue 将被关闭。
sing-box 不是讨好无法作出任何意义上的贡献的最终用户并获取非道德影响力的项目,如果您在此处欺骗以故意浪费开发者的时间,您将被永久封锁。
options:
- label: 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
required: true
- label: 我保证提供了可以在本地重现该问题的服务器、客户端配置文件与流程,而不是一个脱敏的复杂客户端配置文件。
required: true
- label: 我保证提供了可用于重现我报告的错误的最简配置而不是依赖远程服务器、TUN、图形界面客户端或者其他闭源软件。
required: true
- label: 我保证提供了完整的配置文件与日志,而不是出于对自身智力的自信而仅提供了部分认为有用的部分。
required: true

View File

@@ -30,7 +30,7 @@ jobs:
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
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ steps.version.outputs.go_version }}
- name: Add cache to Go proxy
@@ -54,7 +54,7 @@ jobs:
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.18.10
- name: Cache go module
@@ -74,7 +74,7 @@ jobs:
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.20.7
- name: Cache go module
@@ -209,14 +209,14 @@ jobs:
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
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ steps.version.outputs.go_version }}
- name: Build
id: build
run: make
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: sing-box-${{ matrix.name }}
path: sing-box*

View File

@@ -30,7 +30,7 @@ jobs:
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
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ steps.version.outputs.go_version }}
- name: golangci-lint

View File

@@ -8,7 +8,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
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'
days-before-stale: 60

View File

@@ -1,7 +1,7 @@
NAME = sing-box
COMMIT = $(shell git rev-parse --short HEAD)
TAGS_GO118 = with_gvisor,with_dhcp,with_wireguard,with_utls,with_reality_server,with_clash_api
TAGS_GO120 = with_quic,with_ech
TAGS_GO118 = with_gvisor,with_dhcp,with_wireguard,with_reality_server,with_clash_api
TAGS_GO120 = with_quic,with_ech,with_utls
TAGS ?= $(TAGS_GO118),$(TAGS_GO120)
TAGS_TEST ?= with_gvisor,with_quic,with_wireguard,with_grpc,with_ech,with_utls,with_reality_server
@@ -178,9 +178,8 @@ lib:
go run ./cmd/internal/build_libbox -target ios
lib_install:
go get -v -d
go install -v github.com/sagernet/gomobile/cmd/gomobile@v0.0.0-20230915142329-c6740b6d2950
go install -v github.com/sagernet/gomobile/cmd/gobind@v0.0.0-20230915142329-c6740b6d2950
go install -v github.com/sagernet/gomobile/cmd/gomobile@v0.1.1
go install -v github.com/sagernet/gomobile/cmd/gobind@v0.1.1
docs:
mkdocs serve

View File

@@ -17,6 +17,7 @@ import (
type Router interface {
Service
PreStarter
PostStarter
Outbounds() []Outbound

18
box.go
View File

@@ -55,7 +55,7 @@ func New(options Options) (*Box, error) {
ctx = context.Background()
}
ctx = service.ContextWithDefaultRegistry(ctx)
ctx = pause.ContextWithDefaultManager(ctx)
ctx = pause.WithDefaultManager(ctx)
experimentalOptions := common.PtrValueOrDefault(options.Experimental)
applyDebugOptions(common.PtrValueOrDefault(experimentalOptions.Debug))
var needCacheFile bool
@@ -157,9 +157,12 @@ func New(options Options) (*Box, error) {
preServices2 := make(map[string]adapter.Service)
postServices := make(map[string]adapter.Service)
if needCacheFile {
cacheFile := cachefile.New(ctx, common.PtrValueOrDefault(experimentalOptions.CacheFile))
cacheFile := service.FromContext[adapter.CacheFile](ctx)
if cacheFile == nil {
cacheFile = cachefile.New(ctx, common.PtrValueOrDefault(experimentalOptions.CacheFile))
service.MustRegister[adapter.CacheFile](ctx, cacheFile)
}
preServices1["cache file"] = cacheFile
service.MustRegister[adapter.CacheFile](ctx, cacheFile)
}
if needClashAPI {
clashAPIOptions := common.PtrValueOrDefault(experimentalOptions.ClashAPI)
@@ -259,6 +262,10 @@ func (s *Box) preStart() error {
}
}
}
err = s.router.PreStart()
if err != nil {
return E.Cause(err, "pre-start router")
}
err = s.startOutbounds()
if err != nil {
return err
@@ -313,10 +320,7 @@ func (s *Box) postStart() error {
}
}
}
err := s.router.PostStart()
if err != nil {
return E.Cause(err, "post-start router")
}
return s.router.PostStart()
}

View File

@@ -7,7 +7,7 @@ import (
"path/filepath"
"strings"
_ "github.com/sagernet/gomobile/event/key"
_ "github.com/sagernet/gomobile"
"github.com/sagernet/sing-box/cmd/internal/build_shared"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing/common/rw"

View File

@@ -1,7 +1,6 @@
package main
import (
"encoding/json"
"io"
"os"
@@ -9,6 +8,7 @@ import (
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing/common/json"
"github.com/spf13/cobra"
)

View File

@@ -65,50 +65,26 @@ func merge(outputPath string) error {
func mergePathResources(options *option.Options) error {
for index, inbound := range options.Inbounds {
switch inbound.Type {
case C.TypeHTTP:
inbound.HTTPOptions.TLS = mergeTLSInboundOptions(inbound.HTTPOptions.TLS)
case C.TypeMixed:
inbound.MixedOptions.TLS = mergeTLSInboundOptions(inbound.MixedOptions.TLS)
case C.TypeVMess:
inbound.VMessOptions.TLS = mergeTLSInboundOptions(inbound.VMessOptions.TLS)
case C.TypeTrojan:
inbound.TrojanOptions.TLS = mergeTLSInboundOptions(inbound.TrojanOptions.TLS)
case C.TypeNaive:
inbound.NaiveOptions.TLS = mergeTLSInboundOptions(inbound.NaiveOptions.TLS)
case C.TypeHysteria:
inbound.HysteriaOptions.TLS = mergeTLSInboundOptions(inbound.HysteriaOptions.TLS)
case C.TypeVLESS:
inbound.VLESSOptions.TLS = mergeTLSInboundOptions(inbound.VLESSOptions.TLS)
case C.TypeTUIC:
inbound.TUICOptions.TLS = mergeTLSInboundOptions(inbound.TUICOptions.TLS)
case C.TypeHysteria2:
inbound.Hysteria2Options.TLS = mergeTLSInboundOptions(inbound.Hysteria2Options.TLS)
default:
continue
rawOptions, err := inbound.RawOptions()
if err != nil {
return err
}
if tlsOptions, containsTLSOptions := rawOptions.(option.InboundTLSOptionsWrapper); containsTLSOptions {
tlsOptions.ReplaceInboundTLSOptions(mergeTLSInboundOptions(tlsOptions.TakeInboundTLSOptions()))
}
options.Inbounds[index] = inbound
}
for index, outbound := range options.Outbounds {
rawOptions, err := outbound.RawOptions()
if err != nil {
return err
}
switch outbound.Type {
case C.TypeHTTP:
outbound.HTTPOptions.TLS = mergeTLSOutboundOptions(outbound.HTTPOptions.TLS)
case C.TypeVMess:
outbound.VMessOptions.TLS = mergeTLSOutboundOptions(outbound.VMessOptions.TLS)
case C.TypeTrojan:
outbound.TrojanOptions.TLS = mergeTLSOutboundOptions(outbound.TrojanOptions.TLS)
case C.TypeHysteria:
outbound.HysteriaOptions.TLS = mergeTLSOutboundOptions(outbound.HysteriaOptions.TLS)
case C.TypeSSH:
outbound.SSHOptions = mergeSSHOutboundOptions(outbound.SSHOptions)
case C.TypeVLESS:
outbound.VLESSOptions.TLS = mergeTLSOutboundOptions(outbound.VLESSOptions.TLS)
case C.TypeTUIC:
outbound.TUICOptions.TLS = mergeTLSOutboundOptions(outbound.TUICOptions.TLS)
case C.TypeHysteria2:
outbound.Hysteria2Options.TLS = mergeTLSOutboundOptions(outbound.Hysteria2Options.TLS)
default:
continue
}
if tlsOptions, containsTLSOptions := rawOptions.(option.OutboundTLSOptionsWrapper); containsTLSOptions {
tlsOptions.ReplaceOutboundTLSOptions(mergeTLSOutboundOptions(tlsOptions.TakeOutboundTLSOptions()))
}
options.Outbounds[index] = outbound
}

View File

@@ -47,10 +47,14 @@ func compileRuleSet(sourcePath string) error {
return err
}
}
decoder := json.NewDecoder(json.NewCommentFilter(reader))
decoder.DisallowUnknownFields()
var plainRuleSet option.PlainRuleSetCompat
err = decoder.Decode(&plainRuleSet)
content, err := io.ReadAll(reader)
if err != nil {
return err
}
plainRuleSet, err := json.UnmarshalExtended[option.PlainRuleSetCompat](content)
if err != nil {
return err
}
if err != nil {
return err
}

View File

@@ -50,18 +50,14 @@ func formatRuleSet(sourcePath string) error {
if err != nil {
return err
}
decoder := json.NewDecoder(json.NewCommentFilter(bytes.NewReader(content)))
decoder.DisallowUnknownFields()
var plainRuleSet option.PlainRuleSetCompat
err = decoder.Decode(&plainRuleSet)
plainRuleSet, err := json.UnmarshalExtended[option.PlainRuleSetCompat](content)
if err != nil {
return err
}
ruleSet := plainRuleSet.Upgrade()
buffer := new(bytes.Buffer)
encoder := json.NewEncoder(buffer)
encoder.SetIndent("", " ")
err = encoder.Encode(ruleSet)
err = encoder.Encode(plainRuleSet)
if err != nil {
return E.Cause(err, "encode config")
}

View File

@@ -17,6 +17,7 @@ import (
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/json"
"github.com/sagernet/sing/common/json/badjson"
"github.com/spf13/cobra"
@@ -56,8 +57,7 @@ func readConfigAt(path string) (*OptionsEntry, error) {
if err != nil {
return nil, E.Cause(err, "read config at ", path)
}
var options option.Options
err = options.UnmarshalJSON(configContent)
options, err := json.UnmarshalExtended[option.Options](configContent)
if err != nil {
return nil, E.Cause(err, "decode config at ", path)
}
@@ -107,13 +107,18 @@ func readConfigAndMerge() (option.Options, error) {
if len(optionsList) == 1 {
return optionsList[0].options, nil
}
var mergedOptions option.Options
var mergedMessage json.RawMessage
for _, options := range optionsList {
mergedOptions, err = badjson.Merge(options.options, mergedOptions)
mergedMessage, err = badjson.MergeJSON(options.options.RawMessage, mergedMessage)
if err != nil {
return option.Options{}, E.Cause(err, "merge config at ", options.path)
}
}
var mergedOptions option.Options
err = mergedOptions.UnmarshalJSON(mergedMessage)
if err != nil {
return option.Options{}, E.Cause(err, "unmarshal merged config")
}
return mergedOptions, nil
}
@@ -128,7 +133,7 @@ func create() (*box.Box, context.CancelFunc, error) {
}
options.Log.DisableColor = true
}
ctx, cancel := context.WithCancel(context.Background())
ctx, cancel := context.WithCancel(globalCtx)
instance, err := box.New(box.Options{
Context: ctx,
Options: options,

View File

@@ -3,15 +3,19 @@ package main
import (
"context"
"os"
"os/user"
"strconv"
"time"
_ "github.com/sagernet/sing-box/include"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing/service/filemanager"
"github.com/spf13/cobra"
)
var (
globalCtx context.Context
configPaths []string
configDirectories []string
workingDir string
@@ -37,15 +41,30 @@ func main() {
}
func preRun(cmd *cobra.Command, args []string) {
globalCtx = context.Background()
sudoUser := os.Getenv("SUDO_USER")
sudoUID, _ := strconv.Atoi(os.Getenv("SUDO_UID"))
sudoGID, _ := strconv.Atoi(os.Getenv("SUDO_GID"))
if sudoUID == 0 && sudoGID == 0 && sudoUser != "" {
sudoUserObject, _ := user.Lookup(sudoUser)
if sudoUserObject != nil {
sudoUID, _ = strconv.Atoi(sudoUserObject.Uid)
sudoGID, _ = strconv.Atoi(sudoUserObject.Gid)
}
}
if sudoUID > 0 && sudoGID > 0 {
globalCtx = filemanager.WithDefault(globalCtx, "", "", sudoUID, sudoGID)
}
if disableColor {
log.SetStdLogger(log.NewDefaultFactory(context.Background(), log.Formatter{BaseTime: time.Now(), DisableColors: true}, os.Stderr, "", nil, false).Logger())
}
if workingDir != "" {
_, err := os.Stat(workingDir)
if err != nil {
os.MkdirAll(workingDir, 0o777)
filemanager.MkdirAll(globalCtx, workingDir, 0o777)
}
if err := os.Chdir(workingDir); err != nil {
err = os.Chdir(workingDir)
if err != nil {
log.Fatal(err)
}
}

View File

@@ -41,12 +41,12 @@ func NewReadWaitConn(conn tls.Conn) (tls.Conn, error) {
return nil, E.New("badtls: invalid half mutex")
}
halfAccess := (*sync.Mutex)(unsafe.Pointer(rawHalfMutex.UnsafeAddr()))
rawRawInput := rawHalfConn.FieldByName("rawInput")
rawRawInput := rawConn.FieldByName("rawInput")
if !rawRawInput.IsValid() || rawRawInput.Kind() != reflect.Struct {
return nil, E.New("badtls: invalid raw input")
}
rawInput := (*bytes.Buffer)(unsafe.Pointer(rawRawInput.UnsafeAddr()))
rawInput0 := rawHalfConn.FieldByName("input")
rawInput0 := rawConn.FieldByName("input")
if !rawInput0.IsValid() || rawInput0.Kind() != reflect.Struct {
return nil, E.New("badtls: invalid input")
}
@@ -56,10 +56,6 @@ func NewReadWaitConn(conn tls.Conn) (tls.Conn, error) {
return nil, E.New("badtls: invalid hand")
}
hand := (*bytes.Buffer)(unsafe.Pointer(rawHand.UnsafeAddr()))
rawReadRecord := rawConn.MethodByName("readRecord")
if !rawReadRecord.IsValid() {
return nil, E.New("badtls: invalid readRecord")
}
return &ReadWaitConn{
STDConn: stdConn,
halfAccess: halfAccess,

View File

@@ -15,14 +15,17 @@ import (
N "github.com/sagernet/sing/common/network"
)
var _ WireGuardListener = (*DefaultDialer)(nil)
type DefaultDialer struct {
dialer4 tcpDialer
dialer6 tcpDialer
udpDialer4 net.Dialer
udpDialer6 net.Dialer
udpListener net.ListenConfig
udpAddr4 string
udpAddr6 string
dialer4 tcpDialer
dialer6 tcpDialer
udpDialer4 net.Dialer
udpDialer6 net.Dialer
udpListener net.ListenConfig
udpAddr4 string
udpAddr6 string
isWireGuardListener bool
}
func NewDefault(router adapter.Router, options option.DialerOptions) (*DefaultDialer, error) {
@@ -98,6 +101,11 @@ func NewDefault(router adapter.Router, options option.DialerOptions) (*DefaultDi
}
setMultiPathTCP(&dialer4)
}
if options.IsWireGuardListener {
for _, controlFn := range wgControlFns {
listener.Control = control.Append(listener.Control, controlFn)
}
}
tcpDialer4, err := newTCPDialer(dialer4, options.TCPFastOpen)
if err != nil {
return nil, err
@@ -114,6 +122,7 @@ func NewDefault(router adapter.Router, options option.DialerOptions) (*DefaultDi
listener,
udpAddr4,
udpAddr6,
options.IsWireGuardListener,
}, nil
}
@@ -146,6 +155,10 @@ func (d *DefaultDialer) ListenPacket(ctx context.Context, destination M.Socksadd
}
}
func (d *DefaultDialer) ListenPacketCompat(network, address string) (net.PacketConn, error) {
return trackPacketConn(d.udpListener.ListenPacket(context.Background(), network, address))
}
func trackConn(conn net.Conn, err error) (net.Conn, error) {
if !conntrack.Enabled || err != nil {
return conn, err

View File

@@ -6,15 +6,13 @@ import (
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing-dns"
"github.com/sagernet/sing/common"
N "github.com/sagernet/sing/common/network"
)
func MustNew(router adapter.Router, options option.DialerOptions) N.Dialer {
return common.Must1(New(router, options))
}
func New(router adapter.Router, options option.DialerOptions) (N.Dialer, error) {
if options.IsWireGuardListener {
return NewDefault(router, options)
}
var (
dialer N.Dialer
err error

View File

@@ -0,0 +1,9 @@
package dialer
import (
"net"
)
type WireGuardListener interface {
ListenPacketCompat(network, address string) (net.PacketConn, error)
}

View File

@@ -0,0 +1,11 @@
//go:build with_wireguard
package dialer
import (
"github.com/sagernet/wireguard-go/conn"
)
var _ WireGuardListener = (conn.Listener)(nil)
var wgControlFns = conn.ControlFns

View File

@@ -0,0 +1,9 @@
//go:build !with_wireguard
package dialer
import (
"github.com/sagernet/sing/common/control"
)
var wgControlFns []control.Func

View File

@@ -109,8 +109,10 @@ func readRule(reader io.Reader, recovery bool) (rule option.HeadlessRule, err er
}
switch ruleType {
case 0:
rule.Type = C.RuleTypeDefault
rule.DefaultOptions, err = readDefaultRule(reader, recovery)
case 1:
rule.Type = C.RuleTypeLogical
rule.LogicalOptions, err = readLogicalRule(reader, recovery)
default:
err = E.New("unknown rule type: ", ruleType)

View File

@@ -105,5 +105,16 @@ func startACME(ctx context.Context, options option.InboundACMEOptions) (*tls.Con
},
})
config = certmagic.New(cache, *config)
return config.TLSConfig(), &acmeWrapper{ctx: ctx, cfg: config, cache: cache, domain: options.Domain}, nil
var tlsConfig *tls.Config
if acmeConfig.DisableTLSALPNChallenge || acmeConfig.DNS01Solver != nil {
tlsConfig = &tls.Config{
GetCertificate: config.GetCertificate,
}
} else {
tlsConfig = &tls.Config{
GetCertificate: config.GetCertificate,
NextProtos: []string{ACMETLS1Protocol},
}
}
return tlsConfig, &acmeWrapper{ctx: ctx, cfg: config, cache: cache, domain: options.Domain}, nil
}

View File

@@ -0,0 +1,3 @@
package tls
const ACMETLS1Protocol = "acme-tls/1"

View File

@@ -7,6 +7,7 @@ import (
"context"
"crypto/aes"
"crypto/cipher"
"crypto/ecdh"
"crypto/ed25519"
"crypto/hmac"
"crypto/sha256"
@@ -137,12 +138,21 @@ func (e *RealityClientConfig) ClientHandshake(ctx context.Context, conn net.Conn
hello.SessionId[2] = 1
binary.BigEndian.PutUint32(hello.SessionId[4:], uint32(time.Now().Unix()))
copy(hello.SessionId[8:], e.shortID[:])
if debug.Enabled {
fmt.Printf("REALITY hello.sessionId[:16]: %v\n", hello.SessionId[:16])
}
authKey := uConn.HandshakeState.State13.EcdheParams.SharedKey(e.publicKey)
publicKey, err := ecdh.X25519().NewPublicKey(e.publicKey)
if err != nil {
return nil, err
}
ecdheKey := uConn.HandshakeState.State13.EcdheKey
if ecdheKey == nil {
return nil, E.New("nil ecdhe_key")
}
authKey, err := ecdheKey.ECDH(publicKey)
if err != nil {
return nil, err
}
if authKey == nil {
return nil, E.New("nil auth_key")
}

View File

@@ -39,11 +39,19 @@ func (c *STDServerConfig) SetServerName(serverName string) {
}
func (c *STDServerConfig) NextProtos() []string {
return c.config.NextProtos
if c.acmeService != nil && len(c.config.NextProtos) > 1 && c.config.NextProtos[0] == ACMETLS1Protocol {
return c.config.NextProtos[1:]
} else {
return c.config.NextProtos
}
}
func (c *STDServerConfig) SetNextProtos(nextProto []string) {
c.config.NextProtos = nextProto
if c.acmeService != nil && len(c.config.NextProtos) > 1 && c.config.NextProtos[0] == ACMETLS1Protocol {
c.config.NextProtos = append(c.config.NextProtos[:1], nextProto...)
} else {
c.config.NextProtos = nextProto
}
}
func (c *STDServerConfig) Config() (*STDConfig, error) {

View File

@@ -219,6 +219,16 @@ func uTLSClientHelloID(name string) (utls.ClientHelloID, error) {
switch name {
case "chrome", "":
return utls.HelloChrome_Auto, nil
case "chrome_psk":
return utls.HelloChrome_100_PSK, nil
case "chrome_psk_shuffle":
return utls.HelloChrome_112_PSK_Shuf, nil
case "chrome_padding_psk_shuffle":
return utls.HelloChrome_114_Padding_PSK_Shuf, nil
case "chrome_pq":
return utls.HelloChrome_115_PQ, nil
case "chrome_pq_psk":
return utls.HelloChrome_115_PQ_PSK, nil
case "firefox":
return utls.HelloFirefox_Auto, nil
case "edge":

View File

@@ -5,6 +5,7 @@ import (
"net/http/pprof"
"runtime"
"runtime/debug"
"strings"
"github.com/sagernet/sing-box/common/humanize"
"github.com/sagernet/sing-box/log"
@@ -47,12 +48,20 @@ func applyDebugListenOption(options option.DebugOptions) {
encoder.SetIndent("", " ")
encoder.Encode(memObject)
})
r.HandleFunc("/pprof", pprof.Index)
r.HandleFunc("/pprof/*", pprof.Index)
r.HandleFunc("/pprof/cmdline", pprof.Cmdline)
r.HandleFunc("/pprof/profile", pprof.Profile)
r.HandleFunc("/pprof/symbol", pprof.Symbol)
r.HandleFunc("/pprof/trace", pprof.Trace)
r.Route("/pprof", func(r chi.Router) {
r.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
if !strings.HasSuffix(request.URL.Path, "/") {
http.Redirect(writer, request, request.URL.Path+"/", http.StatusMovedPermanently)
} else {
pprof.Index(writer, request)
}
})
r.HandleFunc("/*", pprof.Index)
r.HandleFunc("/cmdline", pprof.Cmdline)
r.HandleFunc("/profile", pprof.Profile)
r.HandleFunc("/symbol", pprof.Symbol)
r.HandleFunc("/trace", pprof.Trace)
})
})
debugHTTPServer = &http.Server{
Addr: options.Listen,

View File

@@ -1,4 +1,4 @@
//go:build !linux
//go:build !(linux || darwin)
package box

View File

@@ -1,3 +1,5 @@
//go:build linux || darwin
package box
import (

View File

@@ -2,6 +2,82 @@
icon: material/alert-decagram
---
#### 1.8.0-rc.10
* Fixes and improvements
#### 1.7.7
* Fix V2Ray transport `path` validation behavior **1**
* Fixes and improvements
**1**:
See [V2Ray transport](/configuration/shared/v2ray-transport/).
#### 1.8.0-rc.7
* Fixes and improvements
#### 1.8.0-rc.3
* Fix V2Ray transport `path` validation behavior **1**
* Fixes and improvements
**1**:
See [V2Ray transport](/configuration/shared/v2ray-transport/).
#### 1.7.6
* Fixes and improvements
#### 1.8.0-rc.1
* Fixes and improvements
#### 1.8.0-beta.9
* Add simple loopback detect
* Fixes and improvements
#### 1.7.5
* Fixes and improvements
#### 1.8.0-alpha.17
* Add GSO support for TUN and WireGuard system interface **1**
* Update uTLS to 1.5.4 **2**
* Update dependencies **3**
* Fixes and improvements
**1**:
See [TUN](/configuration/inbound/tun/) inbound and [WireGuard](/configuration/outbound/wireguard/) outbound.
**2**:
Added some new [fingerprints](/configuration/shared/tls#utls).
Also, starting with this release, uTLS requires at least Go 1.20.
**3**:
Updated `cloudflare-tls`, `gomobile`, `smux`, `tfo-go` and `wireguard-go` to latest, and `gvisor` to `20231204.0`
This may break something, good luck!
#### 1.7.4
* Fixes and improvements
_Due to the long waiting time, this version is no longer waiting for approval
by the Apple App Store, so updates to Apple Platforms will be delayed._
#### 1.8.0-alpha.16
* Fixes and improvements
#### 1.8.0-alpha.15
* Some chaotic changes **1**
@@ -90,13 +166,13 @@ Since GeoIP was deprecated, we made this rule independent, see [Migration](/migr
#### 1.8.0-alpha.1
* Migrate cache file from Clash API to independent options **1**
* Introducing [Rule Set](/configuration/rule-set) **2**
* Introducing [Rule Set](/configuration/rule-set/) **2**
* Add `sing-box geoip`, `sing-box geosite` and `sing-box rule-set` commands **3**
* Allow nested logical rules **4**
**1**:
See [Cache File](/configuration/experimental/cache-file) and
See [Cache File](/configuration/experimental/cache-file/) and
[Migration](/migration/#migrate-cache-file-from-clash-api-to-independent-options).
**2**:
@@ -107,11 +183,11 @@ it can include more types of rules, load faster,
use less memory, and update automatically.
See [Route#rule_set](/configuration/route/#rule_set),
[Route Rule](/configuration/route/rule),
[DNS Rule](/configuration/dns/rule),
[Rule Set](/configuration/rule-set),
[Source Format](/configuration/rule-set/source-format) and
[Headless Rule](/configuration/rule-set/headless-rule).
[Route Rule](/configuration/route/rule/),
[DNS Rule](/configuration/dns/rule/),
[Rule Set](/configuration/rule-set/),
[Source Format](/configuration/rule-set/source-format/) and
[Headless Rule](/configuration/rule-set/headless-rule/).
For GEO resources migration, see [Migrate GeoIP to rule sets](/migration/#migrate-geoip-to-rule-sets) and
[Migrate Geosite to rule sets](/migration/#migrate-geosite-to-rule-sets).
@@ -130,8 +206,8 @@ Logical rules in route rules, DNS rules, and the new headless rule now allow nes
Important changes since 1.6:
* Add [exclude route support](/configuration/inbound/tun) for TUN inbound
* Add `udp_disable_domain_unmapping` [inbound listen option](/configuration/shared/listen) **1**
* Add [exclude route support](/configuration/inbound/tun/) for TUN inbound
* Add `udp_disable_domain_unmapping` [inbound listen option](/configuration/shared/listen/) **1**
* Add [HTTPUpgrade V2Ray transport](/configuration/shared/v2ray-transport#HTTPUpgrade) support **2**
* Migrate multiplex and UoT server to inbound **3**
* Add TCP Brutal support for multiplex **4**
@@ -155,13 +231,14 @@ The new HTTPUpgrade transport has better performance than WebSocket and is bette
**3**:
Starting in 1.7.0, multiplexing support is no longer enabled by default and needs to be turned on explicitly in inbound
Starting in 1.7.0, multiplexing support is no longer enabled by default
and needs to be turned on explicitly in inbound
options.
**4**
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**:
@@ -250,7 +327,7 @@ Only supported in graphical clients on Android and iOS.
#### 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
#### 1.7.0-alpha.6
@@ -270,7 +347,7 @@ options.
**2**
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
@@ -289,13 +366,13 @@ The new HTTPUpgrade transport has better performance than WebSocket and is bette
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 brutal congestion control for Hysteria2
* Add `brutal_debug` option for Hysteria2
* Update legacy Hysteria protocol **2**
* Add TLS self sign key pair generate command
* Remove [Deprecated Features](/deprecated) by agreement
* Remove [Deprecated Features](/deprecated/) by agreement
**1**:
@@ -313,8 +390,8 @@ the old protocol (Hysteria 1) have been updated to be consistent with Hysteria 2
#### 1.7.0-alpha.1
* Add [exclude route support](/configuration/inbound/tun) for TUN inbound
* Add `udp_disable_domain_unmapping` [inbound listen option](/configuration/shared/listen) **1**
* Add [exclude route support](/configuration/inbound/tun/) for TUN inbound
* Add `udp_disable_domain_unmapping` [inbound listen option](/configuration/shared/listen/) **1**
* Fixes and improvements
**1**:
@@ -337,7 +414,8 @@ When `auto_route` is enabled and `strict_route` is disabled, the device can now
**2**:
Built using Go 1.20, the last version that will run on Windows 7, 8, Server 2008, Server 2012 and macOS 10.13 High
Built using Go 1.20, the last version that will run on
Windows 7, 8, Server 2008, Server 2012 and macOS 10.13 High
Sierra, 10.14 Mojave.
#### 1.6.0-rc.4
@@ -351,7 +429,8 @@ Sierra, 10.14 Mojave.
**1**:
Built using Go 1.20, the last version that will run on Windows 7, 8, Server 2008, Server 2012 and macOS 10.13 High
Built using Go 1.20, the last version that will run on
Windows 7, 8, Server 2008, Server 2012 and macOS 10.13 High
Sierra, 10.14 Mojave.
#### 1.6.0-beta.4
@@ -432,7 +511,7 @@ introduce new issues.
#### 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
#### 1.6.0-alpha.3
@@ -452,7 +531,7 @@ introduce new issues.
* Update BBR congestion control for TUIC and Hysteria2 **1**
* Update quic-go to v0.39.0
* Update gVisor to 20230814.0
* Remove [Deprecated Features](/deprecated) by agreement
* Remove [Deprecated Features](/deprecated/) by agreement
* Fixes and improvements
**1**:
@@ -466,7 +545,7 @@ This update is intended to address the multi-send defects of the old implementat
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
* Add TLS ECH key pair generator **1**
* Add TLS ECH support for QUIC based protocols **2**
@@ -475,7 +554,7 @@ Important changes since 1.4:
* Add `interrupt_exist_connections` option for `Selector` and `URLTest` outbounds **4**
* Add DNS01 challenge support for ACME TLS certificate issuer **5**
* Add `merge` command **6**
* Mark [Deprecated Features](/deprecated)
* Mark [Deprecated Features](/deprecated/)
**1**:
@@ -487,7 +566,7 @@ All inbounds and outbounds are supported, including `Naiveproxy`, `Hysteria[/2]`
**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)
@@ -500,7 +579,7 @@ Only inbound connections are affected by this setting, internal connections will
**5**:
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**:
@@ -582,7 +661,7 @@ Global Flags:
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/).
#### 1.5.0-beta.10
@@ -611,7 +690,7 @@ Only inbound connections are affected by this setting, internal connections will
* Fix compatibility issues with official Hysteria2 server and client
* Fixes and improvements
* Mark [deprecated features](/deprecated)
* Mark [deprecated features](/deprecated/)
#### 1.5.0-beta.3
@@ -630,13 +709,13 @@ Hysteria2 server and client when using `fastOpen=false` or UDP MTU >= 1200.
**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)
#### 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
* Add TLS ECH key pair generator **1**
* Add TLS ECH support for QUIC based protocols **2**
@@ -669,12 +748,12 @@ Important changes since 1.3:
*1*:
See [TUIC inbound](/configuration/inbound/tuic)
and [TUIC outbound](/configuration/outbound/tuic)
See [TUIC inbound](/configuration/inbound/tuic/)
and [TUIC outbound](/configuration/outbound/tuic/)
**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
another program compatible with the protocol as a server.
@@ -705,7 +784,7 @@ Requires sing-box to be compiled with Go 1.21.
**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
another program compatible with the protocol as a server.
@@ -743,8 +822,8 @@ Requires sing-box to be compiled with Go 1.21.
*1*:
See [TUIC inbound](/configuration/inbound/tuic)
and [TUIC outbound](/configuration/outbound/tuic)
See [TUIC inbound](/configuration/inbound/tuic/)
and [TUIC outbound](/configuration/outbound/tuic/)
#### 1.3.6
@@ -753,7 +832,7 @@ and [TUIC outbound](/configuration/outbound/tuic)
#### 1.3.5
* 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 profile sharing support for Android/iOS/macOS clients
@@ -780,7 +859,8 @@ downloaded through TestFlight.
#### 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
**1**:
@@ -801,7 +881,7 @@ The old testflight link and app are no longer valid.
Important changes since 1.2:
* Add [FakeIP](/configuration/dns/fakeip) support **1**
* Add [FakeIP](/configuration/dns/fakeip/) support **1**
* Improve multiplex **2**
* Add [DNS reverse mapping](/configuration/dns#reverse_mapping) support
* Add `rewrite_ttl` DNS rule action
@@ -828,11 +908,11 @@ Important changes since 1.2:
*1*:
See [FAQ](/faq/fakeip) for more information.
See [FAQ](/faq/fakeip/) for more information.
*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
@@ -894,7 +974,7 @@ Improved performance and reduced memory usage.
*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
@@ -946,25 +1026,25 @@ This is an incompatible update for XUDP in VLESS if vision flow is enabled.
#### 1.3-beta1
* 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 [FakeIP](/configuration/dns/fakeip) support **2**
* Add [FakeIP](/configuration/dns/fakeip/) support **2**
* Add `store_fakeip` Clash API option
* Add multi-peer support for [WireGuard](/configuration/outbound/wireguard#peers) outbound
* Add loopback detect
*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.
*2*:
See [FAQ](/faq/fakeip) for more information.
See [FAQ](/faq/fakeip/) for more information.
#### 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
* Update reality protocol
* Fix TTL calculation for DNS response
@@ -993,16 +1073,16 @@ to `domain` rule.
Important changes since 1.1:
* Introducing our [new iOS client application](/installation/clients/sfi)
* Introducing [UDP over TCP protocol version 2](/configuration/shared/udp-over-tcp)
* Introducing our [new iOS client application](/installation/clients/sfi/)
* Introducing [UDP over TCP protocol version 2](/configuration/shared/udp-over-tcp/)
* 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 [VLESS server](/configuration/inbound/vless) and [vision](/configuration/outbound/vless#flow) support
* Add [reality TLS](/configuration/shared/tls) support
* Add [NTP service](/configuration/ntp)
* Add [DHCP DNS server](/configuration/dns/server) support
* Add SSH [host key validation](/configuration/outbound/ssh) support
* Add [query_type](/configuration/dns/rule) DNS rule item
* Add [VLESS server](/configuration/inbound/vless/) and [vision](/configuration/outbound/vless#flow) support
* Add [reality TLS](/configuration/shared/tls/) support
* Add [NTP service](/configuration/ntp/)
* Add [DHCP DNS server](/configuration/dns/server/) support
* Add SSH [host key validation](/configuration/outbound/ssh/) support
* Add [query_type](/configuration/dns/rule/) DNS rule item
* Add fallback support for v2ray transport
* Add custom TLS server support for http based v2ray transports
* Add health check support for http-based v2ray transports
@@ -1033,7 +1113,7 @@ name.
#### 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
* Remove length limit on short_id for reality TLS config
* Fix bugs and update dependencies
@@ -1050,7 +1130,7 @@ name.
#### 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 custom TLS server support for http based v2ray transports
* Add generate commands
@@ -1063,8 +1143,8 @@ name.
#### 1.2-beta5
* Add [VLESS server](/configuration/inbound/vless) and [vision](/configuration/outbound/vless#flow) support
* Add [reality TLS](/configuration/shared/tls) support
* Add [VLESS server](/configuration/inbound/vless/) and [vision](/configuration/outbound/vless#flow) support
* Add [reality TLS](/configuration/shared/tls/) support
* Fix match private address
#### 1.1.6
@@ -1079,7 +1159,7 @@ name.
#### 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 strict mode support for shadowtls v3
* Add uTLS support for shadowtls v3
@@ -1099,9 +1179,9 @@ name.
#### 1.2-beta1
* Add [DHCP DNS server](/configuration/dns/server) support
* Add SSH [host key validation](/configuration/outbound/ssh) support
* Add [query_type](/configuration/dns/rule) DNS rule item
* Add [DHCP DNS server](/configuration/dns/server/) support
* Add SSH [host key validation](/configuration/outbound/ssh/) support
* Add [query_type](/configuration/dns/rule/) DNS rule item
* Add v2ray [user stats](/configuration/experimental#statsusers) api
* Add new clash DNS query api
* Improve vmess request
@@ -1330,7 +1410,7 @@ and [ShadowTLS outbound](/configuration/outbound/shadowtls#version)
#### 1.1-beta6
* Add [URLTest outbound](/configuration/outbound/urltest)
* Add [URLTest outbound](/configuration/outbound/urltest/)
* Fix bugs in 1.1-beta5
#### 1.1-beta5
@@ -1362,8 +1442,8 @@ The default tun stack is changed to system.
#### 1.1-beta4
* Add internal simple-obfs and v2ray-plugin [Shadowsocks plugins](/configuration/outbound/shadowsocks#plugin)
* Add [ShadowsocksR outbound](/configuration/outbound/shadowsocksr)
* Add [VLESS outbound and XUDP](/configuration/outbound/vless)
* Add [ShadowsocksR outbound](/configuration/outbound/shadowsocksr/)
* Add [VLESS outbound and XUDP](/configuration/outbound/vless/)
* Skip wait for hysteria tcp handshake response
* Fix socks4 client
* Fix hysteria inbound
@@ -1390,7 +1470,7 @@ The default tun stack is changed to system.
*1*:
Switching modes using the Clash API, and `store-selected` are now supported,
see [Experimental](/configuration/experimental).
see [Experimental](/configuration/experimental/).
*2*:
@@ -1471,15 +1551,15 @@ and [Listen Fields](/configuration/shared/listen#udp_fragment).
* Fix write trojan udp
* Fix DNS routing
* Add attribute support for geosite
* Update documentation for [Dial Fields](/configuration/shared/dial)
* Update documentation for [Dial Fields](/configuration/shared/dial/)
#### 1.0-beta3
* Add [chained inbound](/configuration/shared/listen#detour) support
* Add process_path rule item
* Add macOS redirect support
* Add ShadowTLS [Inbound](/configuration/inbound/shadowtls), [Outbound](/configuration/outbound/shadowtls)
and [Examples](/examples/shadowtls)
* Add ShadowTLS [Inbound](/configuration/inbound/shadowtls/), [Outbound](/configuration/outbound/shadowtls/)
and [Examples](/examples/shadowtls/)
* Fix search android package in non-owner users
* Fix socksaddr type condition
* Fix smux session status
@@ -1523,7 +1603,7 @@ and [Listen Fields](/configuration/shared/listen#udp_fragment).
##### 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)
* Add proxy protocol support
* Free memory after start
@@ -1532,13 +1612,13 @@ and [Listen Fields](/configuration/shared/listen#udp_fragment).
##### 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
##### 2022/08/21
* Add [Tor outbound](/configuration/outbound/tor)
* Add [SSH outbound](/configuration/outbound/ssh)
* Add [Tor outbound](/configuration/outbound/tor/)
* Add [SSH outbound](/configuration/outbound/ssh/)
##### 2022/08/20
@@ -1552,8 +1632,8 @@ and [Listen Fields](/configuration/shared/listen#udp_fragment).
##### 2022/08/19
* Add Hysteria [Inbound](/configuration/inbound/hysteria) and [Outbund](/configuration/outbound/hysteria)
* Add [ACME TLS certificate issuer](/configuration/shared/tls)
* Add Hysteria [Inbound](/configuration/inbound/hysteria/) and [Outbund](/configuration/outbound/hysteria/)
* Add [ACME TLS certificate issuer](/configuration/shared/tls/)
* Allow read config from stdin (-c stdin)
* Update gVisor to 20220815.0
@@ -1571,11 +1651,11 @@ and [Listen Fields](/configuration/shared/listen#udp_fragment).
##### 2022/08/16
* Add ip_version (route/dns) rule item
* Add [WireGuard](/configuration/outbound/wireguard) outbound
* Add [WireGuard](/configuration/outbound/wireguard/) outbound
##### 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
@@ -1584,15 +1664,15 @@ and [Listen Fields](/configuration/shared/listen#udp_fragment).
##### 2022/08/12
* Performance improvements
* Add UoT option for [SOCKS](/configuration/outbound/socks) outbound
* Add UoT option for [SOCKS](/configuration/outbound/socks/) outbound
##### 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
* Add full-featured [Naive](/configuration/inbound/naive) inbound
* Add full-featured [Naive](/configuration/inbound/naive/) inbound
* Fix default dns server option [#9] by iKirby
##### 2022/08/09

View File

@@ -18,6 +18,7 @@ SFA provides an unprivileged TUN implementation through Android VpnService.
| `inet4_address` | :material-check: | / |
| `inet6_address` | :material-check: | / |
| `mtu` | :material-check: | / |
| `gso` | :material-close: | No permission |
| `auto_route` | :material-check: | / |
| `strict_route` | :material-close: | Not implemented |
| `inet4_route_address` | :material-check: | / |

View File

@@ -14,28 +14,29 @@ SFI/SFM/SFT allows you to run sing-box through NetworkExtension with Application
SFI/SFM/SFT provides an unprivileged TUN implementation through NetworkExtension.
| TUN inbound option | Available | Note |
|-------------------------------|-----------|-------------------|
| `interface_name` | ✖️ | Managed by Darwin |
| `inet4_address` | ✔️ | / |
| `inet6_address` | ✔️ | / |
| `mtu` | ✔️ | / |
| `auto_route` | ✔️ | / |
| `strict_route` | ✖️ | Not implemented |
| `inet4_route_address` | ✔️ | / |
| `inet6_route_address` | ✔️ | / |
| `inet4_route_exclude_address` | ✔️ | / |
| `inet6_route_exclude_address` | ✔️ | / |
| `endpoint_independent_nat` | ✔️ | / |
| `stack` | ✔️ | / |
| `include_interface` | ✖️ | Not implemented |
| `exclude_interface` | ✖️ | Not implemented |
| `include_uid` | ✖️ | Not implemented |
| `exclude_uid` | ✖️ | Not implemented |
| `include_android_user` | ✖️ | Not implemented |
| `include_package` | ✖️ | Not implemented |
| `exclude_package` | ✖️ | Not implemented |
| `platform` | ✔️ | / |
| TUN inbound option | Available | Note |
|-------------------------------|-------------------|-------------------|
| `interface_name` | :material-close: | Managed by Darwin |
| `inet4_address` | :material-check: | / |
| `inet6_address` | :material-check: | / |
| `mtu` | :material-check: | / |
| `gso` | :material-close: | Not implemented |
| `auto_route` | :material-check: | / |
| `strict_route` | :material-close: | Not implemented |
| `inet4_route_address` | :material-check: | / |
| `inet6_route_address` | :material-check: | / |
| `inet4_route_exclude_address` | :material-check: | / |
| `inet6_route_exclude_address` | :material-check: | / |
| `endpoint_independent_nat` | :material-check: | / |
| `stack` | :material-check: | / |
| `include_interface` | :material-close: | Not implemented |
| `exclude_interface` | :material-close: | Not implemented |
| `include_uid` | :material-close: | Not implemented |
| `exclude_uid` | :material-close: | Not implemented |
| `include_android_user` | :material-close: | Not implemented |
| `include_package` | :material-close: | Not implemented |
| `exclude_package` | :material-close: | Not implemented |
| `platform` | :material-check: | / |
| Route/DNS rule option | Available | Note |
|-----------------------|------------------|-----------------------|

View File

@@ -2,11 +2,11 @@
Maintained by Project S to provide a unified experience and platform-specific functionality.
| Platform | Client |
|---------------------------------------|-----------------------------------------|
| :material-android: Android | [sing-box for Android](./android) |
| :material-apple: iOS/macOS/Apple tvOS | [sing-box for Apple platforms](./apple) |
| :material-laptop: Desktop | Working in progress |
| Platform | Client |
|---------------------------------------|------------------------------------------|
| :material-android: Android | [sing-box for Android](./android/) |
| :material-apple: iOS/macOS/Apple tvOS | [sing-box for Apple platforms](./apple/) |
| :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
motivation of the maintainers of such projects is to acquire more users, and even though they provide friendly VPN

View File

@@ -4,8 +4,8 @@
| 平台 | 客户端 |
|---------------------------------------|-----------------------------------------|
| :material-android: Android | [sing-box for Android](./android) |
| :material-apple: iOS/macOS/Apple tvOS | [sing-box for Apple platforms](./apple) |
| :material-android: Android | [sing-box for Android](./android/) |
| :material-apple: iOS/macOS/Apple tvOS | [sing-box for Apple platforms](./apple/) |
| :material-laptop: Desktop | 施工中 |
此处没有列出一些声称使用或以 sing-box 为卖点的第三方项目。此类项目维护者的动机是获得更多用户,即使它们提供友好的商业

View File

@@ -23,9 +23,9 @@
| Key | Format |
|----------|--------------------------------|
| `server` | List of [DNS Server](./server) |
| `rules` | List of [DNS Rule](./rule) |
| `fakeip` | [FakeIP](./fakeip) |
| `server` | List of [DNS Server](./server/) |
| `rules` | List of [DNS Rule](./rule/) |
| `fakeip` | [FakeIP](./fakeip/) |
#### final
@@ -62,4 +62,4 @@ problematic in environments such as macOS, where DNS is proxied and cached by th
#### fakeip
[FakeIP](./fakeip) settings.
[FakeIP](./fakeip/) settings.

View File

@@ -21,10 +21,10 @@
### 字段
| 键 | 格式 |
|----------|------------------------|
| `server` | 一组 [DNS 服务器](./server) |
| `rules` | 一组 [DNS 规则](./rule) |
| 键 | 格式 |
|----------|-------------------------|
| `server` | 一组 [DNS 服务器](./server/) |
| `rules` | 一组 [DNS 规则](./rule/) |
#### final
@@ -60,4 +60,4 @@
#### fakeip
[FakeIP](./fakeip) 设置。
[FakeIP](./fakeip/) 设置。

View File

@@ -134,13 +134,15 @@ icon: material/alert-decagram
The default rule uses the following matching logic:
(`domain` || `domain_suffix` || `domain_keyword` || `domain_regex` || `geosite`) &&
(`port` || `port_range`) &&
(`source_geoip` || `source_ip_cidr`) &&
(`source_geoip` || `source_ip_cidr` `source_ip_is_private`) &&
(`source_port` || `source_port_range`) &&
`other fields`
Additionally, included rule sets can be considered merged rather than as a single rule sub-item.
#### inbound
Tags of [Inbound](/configuration/inbound).
Tags of [Inbound](/configuration/inbound/).
#### ip_version

View File

@@ -131,13 +131,15 @@ icon: material/alert-decagram
默认规则使用以下匹配逻辑:
(`domain` || `domain_suffix` || `domain_keyword` || `domain_regex` || `geosite`) &&
(`port` || `port_range`) &&
(`source_geoip` || `source_ip_cidr`) &&
(`source_geoip` || `source_ip_cidr` || `source_ip_is_private`) &&
(`source_port` || `source_port_range`) &&
`other fields`
另外,引用的规则集可视为被合并,而不是作为一个单独的规则子项。
#### inbound
[入站](/zh/configuration/inbound) 标签.
[入站](/zh/configuration/inbound/) 标签.
#### ip_version

View File

@@ -30,18 +30,18 @@ The tag of the dns server.
The address of the dns server.
| Protocol | Format |
|-------------------------------------|-------------------------------|
| `System` | `local` |
| `TCP` | `tcp://1.0.0.1` |
| `UDP` | `8.8.8.8` `udp://8.8.4.4` |
| `TLS` | `tls://dns.google` |
| `HTTPS` | `https://1.1.1.1/dns-query` |
| `QUIC` | `quic://dns.adguard.com` |
| `HTTP3` | `h3://8.8.8.8/dns-query` |
| `RCode` | `rcode://refused` |
| `DHCP` | `dhcp://auto` or `dhcp://en0` |
| [FakeIP](/configuration/dns/fakeip) | `fakeip` |
| Protocol | Format |
|--------------------------------------|-------------------------------|
| `System` | `local` |
| `TCP` | `tcp://1.0.0.1` |
| `UDP` | `8.8.8.8` `udp://8.8.4.4` |
| `TLS` | `tls://dns.google` |
| `HTTPS` | `https://1.1.1.1/dns-query` |
| `QUIC` | `quic://dns.adguard.com` |
| `HTTP3` | `h3://8.8.8.8/dns-query` |
| `RCode` | `rcode://refused` |
| `DHCP` | `dhcp://auto` or `dhcp://en0` |
| [FakeIP](/configuration/dns/fakeip/) | `fakeip` |
!!! warning ""

View File

@@ -30,18 +30,18 @@ DNS 服务器的标签。
DNS 服务器的地址。
| 协议 | 格式 |
|-------------------------------------|------------------------------|
| `System` | `local` |
| `TCP` | `tcp://1.0.0.1` |
| `UDP` | `8.8.8.8` `udp://8.8.4.4` |
| `TLS` | `tls://dns.google` |
| `HTTPS` | `https://1.1.1.1/dns-query` |
| `QUIC` | `quic://dns.adguard.com` |
| `HTTP3` | `h3://8.8.8.8/dns-query` |
| `RCode` | `rcode://refused` |
| `DHCP` | `dhcp://auto``dhcp://en0` |
| [FakeIP](/configuration/dns/fakeip) | `fakeip` |
| 协议 | 格式 |
|--------------------------------------|------------------------------|
| `System` | `local` |
| `TCP` | `tcp://1.0.0.1` |
| `UDP` | `8.8.8.8` `udp://8.8.4.4` |
| `TLS` | `tls://dns.google` |
| `HTTPS` | `https://1.1.1.1/dns-query` |
| `QUIC` | `quic://dns.adguard.com` |
| `HTTP3` | `h3://8.8.8.8/dns-query` |
| `RCode` | `rcode://refused` |
| `DHCP` | `dhcp://auto``dhcp://en0` |
| [FakeIP](/configuration/dns/fakeip/) | `fakeip` |
!!! warning ""

View File

@@ -25,6 +25,6 @@ icon: material/alert-decagram
| Key | Format |
|--------------|----------------------------|
| `cache_file` | [Cache File](./cache-file) |
| `clash_api` | [Clash API](./clash-api) |
| `v2ray_api` | [V2Ray API](./v2ray-api) |
| `cache_file` | [Cache File](./cache-file/) |
| `clash_api` | [Clash API](./clash-api/) |
| `v2ray_api` | [V2Ray API](./v2ray-api/) |

View File

@@ -25,6 +25,6 @@ icon: material/alert-decagram
| 键 | 格式 |
|--------------|--------------------------|
| `cache_file` | [缓存文件](./cache-file) |
| `clash_api` | [Clash API](./clash-api) |
| `v2ray_api` | [V2Ray API](./v2ray-api) |
| `cache_file` | [缓存文件](./cache-file/) |
| `clash_api` | [Clash API](./clash-api/) |
| `v2ray_api` | [V2Ray API](./v2ray-api/) |

View File

@@ -17,7 +17,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### Fields

View File

@@ -20,7 +20,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### Fields

View File

@@ -31,7 +31,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### Fields

View File

@@ -35,7 +35,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### Fields

View File

@@ -15,24 +15,24 @@
### Fields
| Type | Format | Injectable |
|---------------|------------------------------|------------|
| `direct` | [Direct](./direct) | X |
| `mixed` | [Mixed](./mixed) | TCP |
| `socks` | [SOCKS](./socks) | TCP |
| `http` | [HTTP](./http) | TCP |
| `shadowsocks` | [Shadowsocks](./shadowsocks) | TCP |
| `vmess` | [VMess](./vmess) | TCP |
| `trojan` | [Trojan](./trojan) | TCP |
| `naive` | [Naive](./naive) | X |
| `hysteria` | [Hysteria](./hysteria) | X |
| `shadowtls` | [ShadowTLS](./shadowtls) | TCP |
| `tuic` | [TUIC](./tuic) | X |
| `hysteria2` | [Hysteria2](./hysteria2) | X |
| `vless` | [VLESS](./vless) | TCP |
| `tun` | [Tun](./tun) | X |
| `redirect` | [Redirect](./redirect) | X |
| `tproxy` | [TProxy](./tproxy) | X |
| Type | Format | Injectable |
|---------------|-------------------------------|------------|
| `direct` | [Direct](./direct/) | X |
| `mixed` | [Mixed](./mixed/) | TCP |
| `socks` | [SOCKS](./socks/) | TCP |
| `http` | [HTTP](./http/) | TCP |
| `shadowsocks` | [Shadowsocks](./shadowsocks/) | TCP |
| `vmess` | [VMess](./vmess/) | TCP |
| `trojan` | [Trojan](./trojan/) | TCP |
| `naive` | [Naive](./naive/) | X |
| `hysteria` | [Hysteria](./hysteria/) | X |
| `shadowtls` | [ShadowTLS](./shadowtls/) | TCP |
| `tuic` | [TUIC](./tuic/) | X |
| `hysteria2` | [Hysteria2](./hysteria2/) | X |
| `vless` | [VLESS](./vless/) | TCP |
| `tun` | [Tun](./tun/) | X |
| `redirect` | [Redirect](./redirect/) | X |
| `tproxy` | [TProxy](./tproxy/) | X |
#### tag

View File

@@ -17,22 +17,22 @@
| 类型 | 格式 | 注入支持 |
|---------------|------------------------------|------|
| `direct` | [Direct](./direct) | X |
| `mixed` | [Mixed](./mixed) | TCP |
| `socks` | [SOCKS](./socks) | TCP |
| `http` | [HTTP](./http) | TCP |
| `shadowsocks` | [Shadowsocks](./shadowsocks) | TCP |
| `vmess` | [VMess](./vmess) | TCP |
| `trojan` | [Trojan](./trojan) | TCP |
| `naive` | [Naive](./naive) | X |
| `hysteria` | [Hysteria](./hysteria) | X |
| `shadowtls` | [ShadowTLS](./shadowtls) | TCP |
| `tuic` | [TUIC](./tuic) | X |
| `hysteria2` | [Hysteria2](./hysteria2) | X |
| `vless` | [VLESS](./vless) | TCP |
| `tun` | [Tun](./tun) | X |
| `redirect` | [Redirect](./redirect) | X |
| `tproxy` | [TProxy](./tproxy) | X |
| `direct` | [Direct](./direct/) | X |
| `mixed` | [Mixed](./mixed/) | TCP |
| `socks` | [SOCKS](./socks/) | TCP |
| `http` | [HTTP](./http/) | TCP |
| `shadowsocks` | [Shadowsocks](./shadowsocks/) | TCP |
| `vmess` | [VMess](./vmess/) | TCP |
| `trojan` | [Trojan](./trojan/) | TCP |
| `naive` | [Naive](./naive/) | X |
| `hysteria` | [Hysteria](./hysteria/) | X |
| `shadowtls` | [ShadowTLS](./shadowtls/) | TCP |
| `tuic` | [TUIC](./tuic/) | X |
| `hysteria2` | [Hysteria2](./hysteria2/) | X |
| `vless` | [VLESS](./vless/) | TCP |
| `tun` | [Tun](./tun/) | X |
| `redirect` | [Redirect](./redirect/) | X |
| `tproxy` | [TProxy](./tproxy/) | X |
#### tag

View File

@@ -21,7 +21,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### Fields

View File

@@ -20,7 +20,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### Fields

View File

@@ -15,4 +15,4 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.

View File

@@ -50,7 +50,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### Fields

View File

@@ -50,7 +50,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### 字段

View File

@@ -35,7 +35,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### Fields
@@ -66,11 +66,11 @@ Only available in the ShadowTLS protocol 3.
==Required==
Handshake server address and [Dial options](/configuration/shared/dial).
Handshake server address and [Dial options](/configuration/shared/dial/).
#### 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.

View File

@@ -20,7 +20,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### Fields

View File

@@ -17,7 +17,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### Fields

View File

@@ -31,7 +31,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### Fields
@@ -65,4 +65,4 @@ See [Multiplex](/configuration/shared/multiplex#inbound) for details.
#### transport
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport/).

View File

@@ -67,4 +67,4 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
#### transport
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport/)。

View File

@@ -24,7 +24,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### Fields

View File

@@ -1,3 +1,12 @@
---
icon: material/alert-decagram
---
!!! quote "Changes in sing-box 1.8.0"
:material-plus: [gso](#gso)
:material-alert-decagram: [stack](#stack)
!!! quote ""
Only supported on Linux, Windows and macOS.
@@ -12,6 +21,7 @@
"inet4_address": "172.19.0.1/30",
"inet6_address": "fdfe:dcba:9876::1/126",
"mtu": 9000,
"gso": false,
"auto_route": true,
"strict_route": true,
"inet4_route_address": [
@@ -29,6 +39,7 @@
"fc00::/7"
],
"endpoint_independent_nat": false,
"udp_timeout": "5m",
"stack": "system",
"include_interface": [
"lan0"
@@ -98,6 +109,16 @@ IPv6 prefix for the tun interface.
The maximum transmission unit.
#### gso
!!! question "Since sing-box 1.8.0"
!!! quote ""
Only supported on Linux.
Enable generic segmentation offload.
#### auto_route
Set the default route to the Tun.
@@ -160,18 +181,19 @@ UDP NAT expiration time in seconds, default is 300 (5 minutes).
#### stack
!!! quote "Changes in sing-box 1.8.0"
:material-delete-alert: The legacy LWIP stack has been deprecated and removed.
TCP/IP stack.
| Stack | Description | Status |
|--------|----------------------------------------------------------------------------------|-------------------|
| system | Sometimes better performance | recommended |
| gVisor | Better compatibility, based on [google/gvisor](https://github.com/google/gvisor) | recommended |
| mixed | Mixed `system` TCP stack and `gVisor` UDP stack | recommended |
| LWIP | Based on [eycorsican/go-tun2socks](https://github.com/eycorsican/go-tun2socks) | upstream archived |
| Stack | Description |
|----------|-------------------------------------------------------------------------------------------------------|
| `system` | Perform L3 to L4 translation using the system network stack |
| `gvisor` | Perform L3 to L4 translation using [gVisor](https://github.com/google/gvisor)'s virtual network stack |
| `mixed` | Mixed `system` TCP stack and `gvisor` UDP stack |
!!! warning ""
LWIP stacks is not included by default, see [Installation](/installation/build-from-source/#build-tags).
Defaults to the `mixed` stack if the gVisor build tag is enabled, otherwise defaults to the `system` stack.
#### include_interface
@@ -217,10 +239,10 @@ Exclude users in route, but in range.
Limit android users in route.
| Common user | ID |
|--------------|-----|
| Main | 0 |
| Work Profile | 10 |
| Common user | ID |
|--------------|----|
| Main | 0 |
| Work Profile | 10 |
#### include_package
@@ -240,4 +262,4 @@ System HTTP proxy settings.
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.

View File

@@ -1,3 +1,12 @@
---
icon: material/alert-decagram
---
!!! quote "sing-box 1.8.0 中的更改"
:material-plus: [gso](#gso)
:material-alert-decagram: [stack](#stack)
!!! quote ""
仅支持 Linux、Windows 和 macOS。
@@ -12,6 +21,7 @@
"inet4_address": "172.19.0.1/30",
"inet6_address": "fdfe:dcba:9876::1/126",
"mtu": 9000,
"gso": false,
"auto_route": true,
"strict_route": true,
"inet4_route_address": [
@@ -29,6 +39,7 @@
"fc00::/7"
],
"endpoint_independent_nat": false,
"udp_timeout": "5m",
"stack": "system",
"include_interface": [
"lan0"
@@ -98,6 +109,16 @@ tun 接口的 IPv6 前缀。
最大传输单元。
#### gso
!!! question "自 sing-box 1.8.0 起"
!!! quote ""
仅支持 Linux。
启用通用分段卸载。
#### auto_route
设置到 Tun 的默认路由。
@@ -157,17 +178,19 @@ UDP NAT 过期时间,以秒为单位,默认为 3005 分钟)。
#### stack
!!! quote "sing-box 1.8.0 中的更改"
:material-delete-alert: 旧的 LWIP 栈已被弃用并移除。
TCP/IP 栈。
| 栈 | 描述 | 状态 |
|-------------|--------------------------------------------------------------------------|-------|
| system (默认) | 有时性能更好 | 推荐 |
| gVisor | 兼容性较好,基于 [google/gvisor](https://github.com/google/gvisor) | 推荐 |
| LWIP | 基于 [eycorsican/go-tun2socks](https://github.com/eycorsican/go-tun2socks) | 上游已存档 |
| 栈 | 描述 |
|--------|------------------------------------------------------------------|
| system | 基于系统网络栈执行 L3 到 L4 转换 |
| gVisor | 基于 [gVisor](https://github.com/google/gvisor) 虚拟网络栈执行 L3 到 L4 转换 |
| mixed | 混合 `system` TCP 栈与 `gvisor` UDP 栈 |
!!! warning ""
默认安装不包含 LWIP 栈,参阅 [安装](/zh/installation/build-from-source/#_5)。
默认使用 `mixed` 栈如果 gVisor 构建标记已启用,否则默认使用 `system` 栈。
#### include_interface
@@ -214,8 +237,8 @@ TCP/IP 栈。
限制被路由的 Android 用户。
| 常用用户 | ID |
|--|-----|
| 您 | 0 |
|------|----|
| 您 | 0 |
| 工作资料 | 10 |
#### include_package

View File

@@ -22,7 +22,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### Fields
@@ -56,4 +56,4 @@ See [Multiplex](/configuration/shared/multiplex#inbound) for details.
#### transport
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport/).

View File

@@ -56,4 +56,4 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
#### transport
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport/)。

View File

@@ -22,7 +22,7 @@
### Listen Fields
See [Listen Fields](/configuration/shared/listen) for details.
See [Listen Fields](/configuration/shared/listen/) for details.
### Fields
@@ -51,4 +51,4 @@ See [Multiplex](/configuration/shared/multiplex#inbound) for details.
#### transport
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport/).

View File

@@ -51,4 +51,4 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
#### transport
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport/)。

View File

@@ -18,15 +18,15 @@ sing-box uses JSON for configuration files.
### Fields
| Key | Format |
|----------------|--------------------------------|
| `log` | [Log](./log) |
| `dns` | [DNS](./dns) |
| `ntp` | [NTP](./ntp) |
| `inbounds` | [Inbound](./inbound) |
| `outbounds` | [Outbound](./outbound) |
| `route` | [Route](./route) |
| `experimental` | [Experimental](./experimental) |
| Key | Format |
|----------------|---------------------------------|
| `log` | [Log](./log/) |
| `dns` | [DNS](./dns/) |
| `ntp` | [NTP](./ntp/) |
| `inbounds` | [Inbound](./inbound/) |
| `outbounds` | [Outbound](./outbound/) |
| `route` | [Route](./route/) |
| `experimental` | [Experimental](./experimental/) |
### Check

View File

@@ -17,14 +17,14 @@ sing-box 使用 JSON 作为配置文件格式。
### 字段
| Key | Format |
|----------------|-----------------------|
| `log` | [日志](./log) |
| `dns` | [DNS](./dns) |
| `inbounds` | [入站](./inbound) |
| `outbounds` | [出站](./outbound) |
| `route` | [路由](./route) |
| `experimental` | [实验性](./experimental) |
| Key | Format |
|----------------|------------------------|
| `log` | [日志](./log/) |
| `dns` | [DNS](./dns/) |
| `inbounds` | [入站](./inbound/) |
| `outbounds` | [出站](./outbound/) |
| `route` | [路由](./route/) |
| `experimental` | [实验性](./experimental/) |
### 检查

View File

@@ -47,4 +47,4 @@ Time synchronization interval.
### Dial Fields
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -33,4 +33,4 @@ Protocol value can be `1` or `2`.
### Dial Fields
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -55,4 +55,4 @@ TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
### Dial Fields
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -109,4 +109,4 @@ TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
### Dial Fields
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -84,4 +84,4 @@ Enable debug information logging for Hysteria Brutal CC.
### Dial Fields
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -17,24 +17,24 @@
| Type | Format |
|----------------|--------------------------------|
| `direct` | [Direct](./direct) |
| `block` | [Block](./block) |
| `socks` | [SOCKS](./socks) |
| `http` | [HTTP](./http) |
| `shadowsocks` | [Shadowsocks](./shadowsocks) |
| `vmess` | [VMess](./vmess) |
| `trojan` | [Trojan](./trojan) |
| `wireguard` | [Wireguard](./wireguard) |
| `hysteria` | [Hysteria](./hysteria) |
| `vless` | [VLESS](./vless) |
| `shadowtls` | [ShadowTLS](./shadowtls) |
| `tuic` | [TUIC](./tuic) |
| `hysteria2` | [Hysteria2](./hysteria2) |
| `tor` | [Tor](./tor) |
| `ssh` | [SSH](./ssh) |
| `dns` | [DNS](./dns) |
| `selector` | [Selector](./selector) |
| `urltest` | [URLTest](./urltest) |
| `direct` | [Direct](./direct/) |
| `block` | [Block](./block/) |
| `socks` | [SOCKS](./socks/) |
| `http` | [HTTP](./http/) |
| `shadowsocks` | [Shadowsocks](./shadowsocks/) |
| `vmess` | [VMess](./vmess/) |
| `trojan` | [Trojan](./trojan/) |
| `wireguard` | [Wireguard](./wireguard/) |
| `hysteria` | [Hysteria](./hysteria/) |
| `vless` | [VLESS](./vless/) |
| `shadowtls` | [ShadowTLS](./shadowtls/) |
| `tuic` | [TUIC](./tuic/) |
| `hysteria2` | [Hysteria2](./hysteria2/) |
| `tor` | [Tor](./tor/) |
| `ssh` | [SSH](./ssh/) |
| `dns` | [DNS](./dns/) |
| `selector` | [Selector](./selector/) |
| `urltest` | [URLTest](./urltest/) |
#### tag

View File

@@ -17,24 +17,24 @@
| 类型 | 格式 |
|----------------|--------------------------------|
| `direct` | [Direct](./direct) |
| `block` | [Block](./block) |
| `socks` | [SOCKS](./socks) |
| `http` | [HTTP](./http) |
| `shadowsocks` | [Shadowsocks](./shadowsocks) |
| `vmess` | [VMess](./vmess) |
| `trojan` | [Trojan](./trojan) |
| `wireguard` | [Wireguard](./wireguard) |
| `hysteria` | [Hysteria](./hysteria) |
| `vless` | [VLESS](./vless) |
| `shadowtls` | [ShadowTLS](./shadowtls) |
| `tuic` | [TUIC](./tuic) |
| `hysteria2` | [Hysteria2](./hysteria2) |
| `tor` | [Tor](./tor) |
| `ssh` | [SSH](./ssh) |
| `dns` | [DNS](./dns) |
| `selector` | [Selector](./selector) |
| `urltest` | [URLTest](./urltest) |
| `direct` | [Direct](./direct/) |
| `block` | [Block](./block/) |
| `socks` | [SOCKS](./socks/) |
| `http` | [HTTP](./http/) |
| `shadowsocks` | [Shadowsocks](./shadowsocks/) |
| `vmess` | [VMess](./vmess/) |
| `trojan` | [Trojan](./trojan/) |
| `wireguard` | [Wireguard](./wireguard/) |
| `hysteria` | [Hysteria](./hysteria/) |
| `vless` | [VLESS](./vless/) |
| `shadowtls` | [ShadowTLS](./shadowtls/) |
| `tuic` | [TUIC](./tuic/) |
| `hysteria2` | [Hysteria2](./hysteria2/) |
| `tor` | [Tor](./tor/) |
| `ssh` | [SSH](./ssh/) |
| `dns` | [DNS](./dns/) |
| `selector` | [Selector](./selector/) |
| `urltest` | [URLTest](./urltest/) |
#### tag

View File

@@ -89,7 +89,7 @@ Both is enabled by default.
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`.
@@ -99,4 +99,4 @@ See [Multiplex](/configuration/shared/multiplex#outbound) for details.
### Dial Fields
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -89,7 +89,7 @@ Shadowsocks SIP003 插件参数。
UDP over TCP 配置。
参阅 [UDP Over TCP](/zh/configuration/shared/udp-over-tcp)。
参阅 [UDP Over TCP](/zh/configuration/shared/udp-over-tcp/)。
`multiplex` 冲突。

View File

@@ -53,4 +53,4 @@ TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
### Dial Fields
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -59,8 +59,8 @@ Both is enabled by default.
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
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -59,7 +59,7 @@ SOCKS5 密码。
UDP over TCP 配置。
参阅 [UDP Over TCP](/zh/configuration/shared/udp-over-tcp)。
参阅 [UDP Over TCP](/zh/configuration/shared/udp-over-tcp/)。
### 拨号字段

View File

@@ -68,4 +68,4 @@ Client version. Random version will be used if empty.
### Dial Fields
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -48,4 +48,4 @@ See [tor(1)](https://linux.die.net/man/1/tor) for details.
### Dial Fields
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -55,8 +55,8 @@ See [Multiplex](/configuration/shared/multiplex#outbound) for details.
#### transport
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport/).
### Dial Fields
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -55,7 +55,7 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#outbound)。
#### transport
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport/)。
### 拨号字段

View File

@@ -68,7 +68,7 @@ Conflict with `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
another program compatible with the protocol as a server.
@@ -93,4 +93,4 @@ TLS configuration, see [TLS](/configuration/shared/tls/#outbound).
### Dial Fields
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -66,7 +66,7 @@ UDP 包中继模式
#### 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 流)。

View File

@@ -75,8 +75,8 @@ See [Multiplex](/configuration/shared/multiplex#outbound) for details.
#### transport
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport/).
### Dial Fields
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -75,7 +75,7 @@ UDP 包编码,默认使用 xudp。
#### transport
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport/)。
### 拨号字段

View File

@@ -100,8 +100,8 @@ See [Multiplex](/configuration/shared/multiplex#outbound) for details.
#### transport
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport).
V2Ray Transport configuration, see [V2Ray Transport](/configuration/shared/v2ray-transport/).
### Dial Fields
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -100,7 +100,7 @@ UDP 包编码。
#### transport
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport)。
V2Ray 传输配置,参阅 [V2Ray 传输层](/zh/configuration/shared/v2ray-transport/)。
### 拨号字段

View File

@@ -1,3 +1,11 @@
---
icon: material/new-box
---
!!! quote "Changes in sing-box 1.8.0"
:material-plus: [gso](#gso)
### Structure
```json
@@ -8,6 +16,7 @@
"server": "127.0.0.1",
"server_port": 1080,
"system_interface": false,
"gso": false,
"interface_name": "wg0",
"local_address": [
"10.0.0.2/32"
@@ -52,15 +61,25 @@ The server port.
#### system_interface
Use system tun support.
Use system interface.
Requires privilege and cannot conflict with system interfaces.
Requires privilege and cannot conflict with exists system interfaces.
Forced if gVisor not included in the build.
#### interface_name
Custom device name when `system_interface` enabled.
Custom interface name for system interface.
#### gso
!!! question "Since sing-box 1.8.0"
!!! quote ""
Only supported on Linux.
Try to enable generic segmentation offload.
#### local_address
@@ -131,4 +150,4 @@ Both is enabled by default.
### Dial Fields
See [Dial Fields](/configuration/shared/dial) for details.
See [Dial Fields](/configuration/shared/dial/) for details.

View File

@@ -1,3 +1,11 @@
---
icon: material/new-box
---
!!! quote "sing-box 1.8.0 中的更改"
:material-plus: [gso](#gso)
### 结构
```json
@@ -8,6 +16,7 @@
"server": "127.0.0.1",
"server_port": 1080,
"system_interface": false,
"gso": false,
"interface_name": "wg0",
"local_address": [
"10.0.0.2/32"
@@ -40,15 +49,25 @@
#### system_interface
使用系统 tun 支持
使用系统设备
需要特权且不能与系统接口冲突。
需要特权且不能与已有系统接口冲突。
如果 gVisor 未包含在构建中,则强制执行。
#### interface_name
启用 `system_interface` 时的自定义设备名称。
为系统接口自定义设备名称。
#### gso
!!! question "自 sing-box 1.8.0 起"
!!! quote ""
仅支持 Linux。
尝试启用通用分段卸载。
#### local_address

View File

@@ -32,18 +32,18 @@ icon: material/alert-decagram
| Key | Format |
|-----------|----------------------|
| `geoip` | [GeoIP](./geoip) |
| `geosite` | [Geosite](./geosite) |
| `geoip` | [GeoIP](./geoip/) |
| `geosite` | [Geosite](./geosite/) |
#### rules
List of [Route Rule](./rule)
List of [Route Rule](./rule/)
#### rule_set
!!! question "Since sing-box 1.8.0"
List of [Rule Set](/configuration/rule-set)
List of [Rule Set](/configuration/rule-set/)
#### final

View File

@@ -30,21 +30,20 @@ icon: material/alert-decagram
### 字段
| 键 | 格式 |
|------------|-----------------------------------|
| `geoip` | [GeoIP](./geoip) |
| `geosite` | [Geosite](./geosite) |
| 键 | 格式 |
|-----------|-----------------------|
| `geoip` | [GeoIP](./geoip/) |
| `geosite` | [Geosite](./geosite/) |
#### rule
一组 [路由规则](./rule)。
一组 [路由规则](./rule/)
#### rule_set
!!! question "自 sing-box 1.8.0 起"
一组 [规则集](/configuration/rule-set)。
一组 [规则集](/configuration/rule-set/)。
#### final

View File

@@ -134,15 +134,17 @@ icon: material/alert-decagram
!!! note ""
The default rule uses the following matching logic:
(`domain` || `domain_suffix` || `domain_keyword` || `domain_regex` || `geosite` || `geoip` || `ip_cidr`) &&
(`domain` || `domain_suffix` || `domain_keyword` || `domain_regex` || `geosite` || `geoip` || `ip_cidr` || `ip_is_private`) &&
(`port` || `port_range`) &&
(`source_geoip` || `source_ip_cidr`) &&
(`source_geoip` || `source_ip_cidr` || `source_ip_is_private`) &&
(`source_port` || `source_port_range`) &&
`other fields`
Additionally, included rule sets can be considered merged rather than as a single rule sub-item.
#### inbound
Tags of [Inbound](/configuration/inbound).
Tags of [Inbound](/configuration/inbound/).
#### ip_version

View File

@@ -132,15 +132,17 @@ icon: material/alert-decagram
!!! note ""
默认规则使用以下匹配逻辑:
(`domain` || `domain_suffix` || `domain_keyword` || `domain_regex` || `geosite` || `geoip` || `ip_cidr`) &&
(`domain` || `domain_suffix` || `domain_keyword` || `domain_regex` || `geosite` || `geoip` || `ip_cidr` || `ip_is_private`) &&
(`port` || `port_range`) &&
(`source_geoip` || `source_ip_cidr`) &&
(`source_geoip` || `source_ip_cidr` || `source_ip_is_private`) &&
(`source_port` || `source_port_range`) &&
`other fields`
另外,引用的规则集可视为被合并,而不是作为一个单独的规则子项。
#### inbound
[入站](/zh/configuration/inbound) 标签。
[入站](/zh/configuration/inbound/) 标签。
#### ip_version

View File

@@ -31,4 +31,4 @@ Version of Rule Set, must be `1`.
==Required==
List of [Headless Rule](./headless-rule.md).
List of [Headless Rule](./headless-rule.md/).

View File

@@ -7,7 +7,7 @@
"tcp_fast_open": false,
"tcp_multi_path": false,
"udp_fragment": false,
"udp_timeout": 300,
"udp_timeout": "5m",
"detour": "another-in",
"sniff": false,
"sniff_override_destination": false,
@@ -19,14 +19,14 @@
### Fields
| Field | Available Context |
|--------------------------------|-------------------------------------------------------------------|
| `listen` | 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_multi_path` | Needs to listen on TCP. |
| `udp_timeout` | Needs to assemble UDP connections, currently Tun and Shadowsocks. |
| `udp_disable_domain_unmapping` | Needs to listen on UDP and accept domain UDP addresses. |
| Field | Available Context |
|--------------------------------|---------------------------------------------------------|
| `listen` | 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_multi_path` | Needs to listen on TCP. |
| `udp_timeout` | Needs to assemble UDP connections. |
| `udp_disable_domain_unmapping` | Needs to listen on UDP and accept domain UDP addresses. |
#### listen
@@ -56,7 +56,9 @@ Enable UDP fragmentation.
#### 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

View File

@@ -7,7 +7,7 @@
"tcp_fast_open": false,
"tcp_multi_path": false,
"udp_fragment": false,
"udp_timeout": 300,
"udp_timeout": "5m",
"detour": "another-in",
"sniff": false,
"sniff_override_destination": false,
@@ -18,13 +18,13 @@
```
| 字段 | 可用上下文 |
|-----------------------------------|-------------------------------------|
| `listen` | 需要监听 TCP 或 UDP。 |
| `listen_port` | 需要监听 TCP 或 UDP。 |
| `tcp_fast_open` | 需要监听 TCP。 |
| `tcp_multi_path` | 需要监听 TCP。 |
| `udp_timeout` | 需要组装 UDP 连接, 当前为 Tun 和 Shadowsocks。 |
| 字段 | 可用上下文 |
|------------------|-----------------|
| `listen` | 需要监听 TCP 或 UDP。 |
| `listen_port` | 需要监听 TCP 或 UDP。 |
| `tcp_fast_open` | 需要监听 TCP。 |
| `tcp_multi_path` | 需要监听 TCP。 |
| `udp_timeout` | 需要组装 UDP 连接。 |
|
### 字段
@@ -57,7 +57,9 @@
#### udp_timeout
UDP NAT 过期时间,以秒为单位,默认为 3005 分钟)
UDP NAT 过期时间,以秒为单位。
默认使用 `5m`
#### detour

View File

@@ -35,7 +35,7 @@ If enabled, non-padded connections will be rejected.
#### brutal
See [TCP Brutal](/configuration/shared/tcp-brutal) for details.
See [TCP Brutal](/configuration/shared/tcp-brutal/) for details.
### Outbound Fields
@@ -83,4 +83,4 @@ Enable padding.
#### brutal
See [TCP Brutal](/configuration/shared/tcp-brutal) for details.
See [TCP Brutal](/configuration/shared/tcp-brutal/) for details.

Some files were not shown because too many files have changed in this diff Show More