1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
| {
"log": {
"disabled": false,
"level": "info",
"timestamp": true
},
"experimental": {
"clash_api": {
"external_controller": "0.0.0.0:9090",
"external_ui": "ui",
"secret": "password", // 控制台连接密钥,建议修改
"default_mode": "Rule" // 默认分流模式
}
},
"dns": {
"servers": [
{
"tag": "remote",
"type": "https",
"server": "1.1.1.1",
"detour": "Available" // 远程解析走代理
},
{
"tag": "local",
"type": "https",
"server": "223.5.5.5" // 国内解析走直连
}
],
"rules": [
{
"clash_mode": "Proxy",
"action": "route",
"server": "remote"
},
{
"clash_mode": "Direct",
"action": "route",
"server": "local"
},
{
"rule_set": ["geosite-cn"],
"action": "route",
"server": "local"
},
{
"rule_set": ["category-ads-all"],
"action": "reject" // 广告拦截
}
],
"strategy": "ipv4_only"
},
"inbounds": [
{
"type": "mixed",
"tag": "mixed-in",
"listen": "0.0.0.0", // 允许 Docker 容器及局域网访问代理端口
"listen_port": 2333, // 混合代理端口(HTTP/SOCKS)
"sniff": true, // 开启流量嗅探,用于识别域名
"sniff_override_destination": true // 强制将嗅探到的域名作为目标,防止 DNS 污染
},
{
"type": "dns",
"tag": "dns-in",
"listen": "127.0.0.1",
"listen_port": 53 // 劫持本地 53 端口流量到内置 DNS 引擎
}
],
"outbounds": [
{
"type": "selector",
"tag": "Available",
"outbounds": [
"Reality-Out",
"Hy2-Out"
],
"default": "Reality-Out" // 默认使用的出站节点
},
{
"type": "vless",
"tag": "Reality-Out",
"server": "your_vps_ip", // 填入 VPS 的 IP 地址
"server_port": 8881, // 填入 VPS 的端口
"uuid": "your_uuid", // 填入 UUID
"flow": "xtls-rprx-vision",
"tls": {
"enabled": true,
"server_name": "your_sni", // SNI
"utls": {
"enabled": true,
"fingerprint": "firefox" // 使用 Firefox 指纹,昨天看到消息,使用chrome指纹 uTLS 数据包填充缺失漏洞可被GFW利用高效识别代理流量
},
"reality": {
"enabled": true,
"public_key": "your_public_key", // 填入 Reality 公钥
"short_id": "" // 填入 Short ID (如果有)
}
},
"domain_resolver": "local" // 关键:使用本地 DNS 解析服务器 IP 避免解析回环
},
{
"type": "hysteria2",
"tag": "Hy2-Out",
"server": "your_vps_ip",
"server_port": 443,
"password": "your_password", // Hysteria2 节点连接密码
"up_mbps": 30, // 根据你的上行宽带填写
"down_mbps": 100, // 根据你的下行宽带填写
"tls": {
"enabled": true,
"server_name": "your_sni",
"insecure": false, // 正规证书填 false,自签名填 true
"utls": {
"enabled": true,
"fingerprint": "firefox"
}
},
"domain_resolver": "local"
},
{
"type": "direct",
"tag": "direct"
}
],
"route": {
"auto_detect_interface": true, // 自动检测出口网卡,防止流量回环
"default_domain_resolver": "local", // 默认域名解析器
"rules": [
{
"protocol": "dns",
"action": "hijack-dns" // 劫持所有 DNS 流量
},
{
"ip_is_private": true, // 内网 IP 直接连接
"action": "route",
"outbound": "direct"
},
{
"rule_set": ["category-ads-all"],
"action": "reject"
},
{
"rule_set": ["geosite-cn"], // 中国站点直连
"action": "route",
"outbound": "direct"
},
{
"clash_mode": "Proxy", // 强制代理模式下的路由
"action": "route",
"outbound": "Available"
},
{
"clash_mode": "Direct",
"action": "route",
"outbound": "direct"
}
],
"rule_set": [
{
"tag": "geosite-cn",
"type": "remote",
"format": "binary",
"url": "https://fastly.jsdelivr.net/gh/SagerNet/sing-geosite@rule-set/geosite-cn.srs",
"download_detour": "direct"
},
{
"tag": "category-ads-all",
"type": "remote",
"format": "binary",
"url": "https://fastly.jsdelivr.net/gh/SagerNet/sing-geosite@rule-set/geosite-category-ads-all.srs",
"download_detour": "direct"
}
]
}
}
|