File tree Expand file tree Collapse file tree 20 files changed +1268
-4
lines changed Expand file tree Collapse file tree 20 files changed +1268
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ icon : material/new-box
3
+ ---
4
+
5
+ !!! question "自 sing-box 1.12.0 起"
6
+
7
+ # 证书
8
+
9
+ ### 结构
10
+
11
+ ``` json
12
+ {
13
+ "store" : " " ,
14
+ "certificate" : [],
15
+ "certificate_path" : [],
16
+ "certificate_directory_path" : []
17
+ }
18
+ ```
19
+
20
+ !!! note ""
21
+
22
+ 当内容只有一项时,可以忽略 JSON 数组 [] 标签
23
+
24
+ ### 字段
25
+
26
+ #### store
27
+
28
+ 默认的 X509 受信任 CA 证书列表。
29
+
30
+ | 类型 | 描述 |
31
+ | --------------------| --------------------------------------------------------------------------------------------|
32
+ | ` system ` (默认) | 系统受信任的 CA 证书 |
33
+ | ` mozilla ` | [ Mozilla 包含列表] ( https://wiki.mozilla.org/CA/Included_Certificates ) (已移除中国 CA 证书) |
34
+ | ` none ` | 空列表 |
35
+
36
+ #### certificate
37
+
38
+ 要信任的证书行数组,PEM 格式。
39
+
40
+ #### certificate_path
41
+
42
+ !!! note ""
43
+
44
+ 文件修改时将自动重新加载。
45
+
46
+ 要信任的证书路径,PEM 格式。
47
+
48
+ #### certificate_directory_path
49
+
50
+ !!! note ""
51
+
52
+ 文件修改时将自动重新加载。
53
+
54
+ 搜索要信任的证书的目录路径,PEM 格式。
Original file line number Diff line number Diff line change
1
+ ---
2
+ icon : material/new-box
3
+ ---
4
+
5
+ !!! question "自 sing-box 1.12.0 起"
6
+
7
+ # DHCP
8
+
9
+ ### 结构
10
+
11
+ ``` json
12
+ {
13
+ "dns" : {
14
+ "servers" : [
15
+ {
16
+ "type" : " dhcp" ,
17
+ "tag" : " " ,
18
+
19
+ "interface" : " " ,
20
+
21
+ // 拨号字段
22
+ }
23
+ ]
24
+ }
25
+ }
26
+ ```
27
+
28
+ ### 字段
29
+
30
+ #### interface
31
+
32
+ 要监听的网络接口名称。
33
+
34
+ 默认使用默认接口。
35
+
36
+ ### 拨号字段
37
+
38
+ 参阅 [ 拨号字段] ( /zh/configuration/shared/dial/ ) 了解详情。
Original file line number Diff line number Diff line change
1
+ ---
2
+ icon : material/new-box
3
+ ---
4
+
5
+ !!! question "自 sing-box 1.12.0 起"
6
+
7
+ # Fake IP
8
+
9
+ ### 结构
10
+
11
+ ``` json
12
+ {
13
+ "dns" : {
14
+ "servers" : [
15
+ {
16
+ "type" : " fakeip" ,
17
+ "tag" : " " ,
18
+
19
+ "inet4_range" : " 198.18.0.0/15" ,
20
+ "inet6_range" : " fc00::/18"
21
+ }
22
+ ]
23
+ }
24
+ }
25
+ ```
26
+
27
+ ### 字段
28
+
29
+ #### inet4_range
30
+
31
+ FakeIP 的 IPv4 地址范围。
32
+
33
+ #### inet6_range
34
+
35
+ FakeIP 的 IPv6 地址范围。
Original file line number Diff line number Diff line change
1
+ ---
2
+ icon : material/new-box
3
+ ---
4
+
5
+ !!! question "自 sing-box 1.12.0 起"
6
+
7
+ # Hosts
8
+
9
+ ### 结构
10
+
11
+ ``` json
12
+ {
13
+ "dns" : {
14
+ "servers" : [
15
+ {
16
+ "type" : " hosts" ,
17
+ "tag" : " " ,
18
+
19
+ "path" : [],
20
+ "predefined" : {}
21
+ }
22
+ ]
23
+ }
24
+ }
25
+ ```
26
+
27
+ !!! note ""
28
+
29
+ 当内容只有一项时,可以忽略 JSON 数组 [] 标签
30
+
31
+ ### 字段
32
+
33
+ #### path
34
+
35
+ hosts 文件路径列表。
36
+
37
+ 默认使用 ` /etc/hosts ` 。
38
+
39
+ 在 Windows 上默认使用 ` C:\Windows\System32\Drivers\etc\hosts ` 。
40
+
41
+ 示例:
42
+
43
+ ``` json
44
+ {
45
+ // "path": "/etc/hosts"
46
+
47
+ "path" : [
48
+ " /etc/hosts" ,
49
+ " $HOME/.hosts"
50
+ ]
51
+ }
52
+ ```
53
+
54
+ #### predefined
55
+
56
+ 预定义的 hosts。
57
+
58
+ 示例:
59
+
60
+ ``` json
61
+ {
62
+ "predefined" : {
63
+ "www.google.com" : " 127.0.0.1" ,
64
+ "localhost" : [
65
+ " 127.0.0.1" ,
66
+ " ::1"
67
+ ]
68
+ }
69
+ }
70
+ ```
71
+
72
+ ### 示例
73
+
74
+ === "如果可用则使用 hosts"
75
+
76
+ ```json
77
+ {
78
+ "dns": {
79
+ "servers": [
80
+ {
81
+ ...
82
+ },
83
+ {
84
+ "type": "hosts",
85
+ "tag": "hosts"
86
+ }
87
+ ],
88
+ "rules": [
89
+ {
90
+ "ip_accept_any": true,
91
+ "server": "hosts"
92
+ }
93
+ ]
94
+ }
95
+ }
96
+ ```
Original file line number Diff line number Diff line change
1
+ ---
2
+ icon : material/new-box
3
+ ---
4
+
5
+ !!! question "自 sing-box 1.12.0 起"
6
+
7
+ # DNS over HTTP3 (DoH3)
8
+
9
+ ### 结构
10
+
11
+ ``` json
12
+ {
13
+ "dns" : {
14
+ "servers" : [
15
+ {
16
+ "type" : " h3" ,
17
+ "tag" : " " ,
18
+
19
+ "server" : " " ,
20
+ "server_port" : 443 ,
21
+
22
+ "path" : " " ,
23
+ "headers" : {},
24
+
25
+ "tls" : {},
26
+
27
+ // 拨号字段
28
+ }
29
+ ]
30
+ }
31
+ }
32
+ ```
33
+
34
+ !!! info "与旧版 H3 服务器的区别"
35
+
36
+ * 旧服务器默认使用默认出站,除非指定了绕行;新服务器像出站一样使用拨号器,相当于默认使用空的直连出站。
37
+ * 旧服务器使用 `address_resolver` 和 `address_strategy` 来解析服务器中的域名;新服务器改用 [拨号字段](/zh/configuration/shared/dial/) 中的 `domain_resolver` 和 `domain_strategy`。
38
+
39
+ ### 字段
40
+
41
+ #### server
42
+
43
+ ==必填==
44
+
45
+ DNS 服务器的地址。
46
+
47
+ 如果使用域名,还必须设置 ` domain_resolver ` 来解析 IP 地址。
48
+
49
+ #### server_port
50
+
51
+ DNS 服务器的端口。
52
+
53
+ 默认使用 ` 443 ` 。
54
+
55
+ #### path
56
+
57
+ DNS 服务器的路径。
58
+
59
+ 默认使用 ` /dns-query ` 。
60
+
61
+ #### headers
62
+
63
+ 发送到 DNS 服务器的额外标头。
64
+
65
+ #### tls
66
+
67
+ TLS 配置,参阅 [ TLS] ( /zh/configuration/shared/tls/#outbound ) 。
68
+
69
+ ### 拨号字段
70
+
71
+ 参阅 [ 拨号字段] ( /zh/configuration/shared/dial/ ) 了解详情。
Original file line number Diff line number Diff line change
1
+ ---
2
+ icon : material/new-box
3
+ ---
4
+
5
+ !!! question "自 sing-box 1.12.0 起"
6
+
7
+ # DNS over HTTPS (DoH)
8
+
9
+ ### 结构
10
+
11
+ ``` json
12
+ {
13
+ "dns" : {
14
+ "servers" : [
15
+ {
16
+ "type" : " https" ,
17
+ "tag" : " " ,
18
+
19
+ "server" : " " ,
20
+ "server_port" : 443 ,
21
+
22
+ "path" : " " ,
23
+ "headers" : {},
24
+
25
+ "tls" : {},
26
+
27
+ // 拨号字段
28
+ }
29
+ ]
30
+ }
31
+ }
32
+ ```
33
+
34
+ !!! info "与旧版 HTTPS 服务器的区别"
35
+
36
+ * 旧服务器默认使用默认出站,除非指定了绕行;新服务器像出站一样使用拨号器,相当于默认使用空的直连出站。
37
+ * 旧服务器使用 `address_resolver` 和 `address_strategy` 来解析服务器中的域名;新服务器改用 [拨号字段](/zh/configuration/shared/dial/) 中的 `domain_resolver` 和 `domain_strategy`。
38
+
39
+ ### 字段
40
+
41
+ #### server
42
+
43
+ ==必填==
44
+
45
+ DNS 服务器的地址。
46
+
47
+ 如果使用域名,还必须设置 ` domain_resolver ` 来解析 IP 地址。
48
+
49
+ #### server_port
50
+
51
+ DNS 服务器的端口。
52
+
53
+ 默认使用 ` 443 ` 。
54
+
55
+ #### path
56
+
57
+ DNS 服务器的路径。
58
+
59
+ 默认使用 ` /dns-query ` 。
60
+
61
+ #### headers
62
+
63
+ 发送到 DNS 服务器的额外标头。
64
+
65
+ #### tls
66
+
67
+ TLS 配置,参阅 [ TLS] ( /zh/configuration/shared/tls/#outbound ) 。
68
+
69
+ ### 拨号字段
70
+
71
+ 参阅 [ 拨号字段] ( /zh/configuration/shared/dial/ ) 了解详情。
You can’t perform that action at this time.
0 commit comments