clash-kit 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitignore +30 -21
- package/LICENSE.md +8 -8
- package/README.md +133 -124
- package/bin/dns-helper +0 -0
- package/bin/index.js +96 -85
- package/default.yaml +46 -46
- package/index.js +204 -218
- package/lib/api.js +178 -116
- package/lib/commands/init.js +127 -127
- package/lib/commands/proxy.js +73 -73
- package/lib/commands/restart.js +10 -0
- package/lib/commands/start.js +30 -30
- package/lib/commands/status.js +105 -85
- package/lib/commands/stop.js +67 -30
- package/lib/commands/sub.js +81 -81
- package/lib/commands/sysproxy.js +60 -24
- package/lib/commands/test.js +70 -70
- package/lib/commands/tun.js +123 -95
- package/lib/kernel.js +197 -178
- package/lib/port.js +115 -115
- package/lib/subscription.js +128 -125
- package/lib/sysnet.js +73 -52
- package/lib/sysproxy.js +133 -145
- package/lib/tun.js +150 -126
- package/package.json +50 -48
package/.gitignore
CHANGED
|
@@ -1,21 +1,30 @@
|
|
|
1
|
-
.DS_Store
|
|
2
|
-
node_modules
|
|
3
|
-
.env
|
|
4
|
-
dist
|
|
5
|
-
|
|
6
|
-
.vscode
|
|
7
|
-
.idea
|
|
8
|
-
|
|
9
|
-
*.log
|
|
10
|
-
|
|
11
|
-
clash-kit
|
|
12
|
-
clash-kit.exe
|
|
13
|
-
config.yaml
|
|
14
|
-
profiles
|
|
15
|
-
ruleset
|
|
16
|
-
|
|
17
|
-
# clash 相关
|
|
18
|
-
cache.db
|
|
19
|
-
geoip.metadb
|
|
20
|
-
m.yaml
|
|
21
|
-
.current_profile
|
|
1
|
+
.DS_Store
|
|
2
|
+
node_modules
|
|
3
|
+
.env
|
|
4
|
+
dist
|
|
5
|
+
|
|
6
|
+
.vscode
|
|
7
|
+
.idea
|
|
8
|
+
|
|
9
|
+
*.log
|
|
10
|
+
|
|
11
|
+
clash-kit
|
|
12
|
+
clash-kit.exe
|
|
13
|
+
config.yaml
|
|
14
|
+
profiles
|
|
15
|
+
ruleset
|
|
16
|
+
|
|
17
|
+
# clash 相关
|
|
18
|
+
cache.db
|
|
19
|
+
geoip.metadb
|
|
20
|
+
m.yaml
|
|
21
|
+
.current_profile
|
|
22
|
+
dns-helper
|
|
23
|
+
|
|
24
|
+
# brew packages
|
|
25
|
+
clash-kit-*
|
|
26
|
+
|
|
27
|
+
# ai coding
|
|
28
|
+
.agents
|
|
29
|
+
.github
|
|
30
|
+
.gemini
|
package/LICENSE.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020-present, 荣顶 and wechat-bot contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-present, 荣顶 and wechat-bot contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
9
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,124 +1,133 @@
|
|
|
1
|
-
# Clash Kit
|
|
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
|
-
ck on
|
|
66
|
-
|
|
67
|
-
#
|
|
68
|
-
ck
|
|
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
|
-
ck
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
| `ck
|
|
115
|
-
| `ck
|
|
116
|
-
| `ck
|
|
117
|
-
| `ck
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
1
|
+
# Clash Kit
|
|
2
|
+
|
|
3
|
+
<a target="_blank" href="https://github.com/wangrongding/clash-kit"><img src="https://img.shields.io/github/stars/wangrongding/clash-kit" alt="GitHub stars" /></a>
|
|
4
|
+
<a target="_blank" href="https://www.npmjs.com/package/clash-kit"><img src="https://img.shields.io/npm/dt/clash-kit?style=flat&label=downloads&color=cb3837&labelColor=cb0000&logo=npm" alt="npm downloads"/></a>
|
|
5
|
+
|
|
6
|
+
一个基于 Node.js 的 Clash 命令行管理工具,旨在简化 Clash 的配置管理、订阅切换和节点测速等操作。
|
|
7
|
+
|
|
8
|
+
目前已兼容 Windows,MacOs,Linux。
|
|
9
|
+
|
|
10
|
+
## 截图
|
|
11
|
+
|
|
12
|
+
<img width="1920" alt="image" src="https://github.com/user-attachments/assets/1183f778-62b0-4ac7-ab55-b821b66161f0" />
|
|
13
|
+
|
|
14
|
+
## 特性
|
|
15
|
+
|
|
16
|
+
- 🔄 **订阅管理**:支持添加、切换多个订阅源。
|
|
17
|
+
- 🌐 **节点切换**:交互式选择并切换当前使用的代理节点。
|
|
18
|
+
- 🔥 **热重载**:切换订阅后立即生效,无需重启服务。
|
|
19
|
+
- ⚡ **节点测速**:支持多线程并发测速,彩色高亮显示延迟结果。
|
|
20
|
+
- 📊 **状态监控**:实时查看服务运行状态、当前节点及延迟。
|
|
21
|
+
- 🛠 **自动初始化**:自动处理二进制文件权限问题。
|
|
22
|
+
|
|
23
|
+
- 💻 **系统代理**:一键开启/关闭 macOS 系统 HTTP 代理。
|
|
24
|
+
- 🛡 **TUN 模式**:高级网络模式,接管系统所有流量(真 · 全局代理)。
|
|
25
|
+
|
|
26
|
+
## 使用
|
|
27
|
+
|
|
28
|
+
### 1. 安装
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install -g clash-kit
|
|
32
|
+
# 或者
|
|
33
|
+
pnpm add -g clash-kit
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. 初始化
|
|
37
|
+
|
|
38
|
+
首次安装后,需要先初始化 Clash 内核与权限:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
clash init
|
|
42
|
+
# 推荐用简化命令(文档后续均以简化命令为例)
|
|
43
|
+
ck init
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 3. 添加订阅
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# 交互式管理订阅(添加、切换、删除等)【推荐使用这种方式来管理订阅】
|
|
50
|
+
ck sub
|
|
51
|
+
|
|
52
|
+
# 列出所有订阅
|
|
53
|
+
ck sub -l
|
|
54
|
+
|
|
55
|
+
# 手动添加订阅
|
|
56
|
+
ck sub -a "https://example.com/subscribe?token=xxx" -n "abcName"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 4. 启动服务
|
|
60
|
+
|
|
61
|
+
启动 Clash 核心服务(建议在一个单独的终端窗口运行):
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# 启动 Clash 代理服务
|
|
65
|
+
ck on # 或者 ck start
|
|
66
|
+
|
|
67
|
+
# 启动并自动开启系统代理
|
|
68
|
+
ck on -s
|
|
69
|
+
# 启动并自动开启 TUN 模式(全局代理, 需要 sudo 权限)
|
|
70
|
+
ck on -t
|
|
71
|
+
|
|
72
|
+
# 关闭服务并关闭系统代理
|
|
73
|
+
ck off # 或者 ck stop
|
|
74
|
+
|
|
75
|
+
# 重新启动服务
|
|
76
|
+
ck rs # 或者 ck restart
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 4. 节点切换(自动测速)
|
|
80
|
+
|
|
81
|
+
进入交互式界面,自动对当前节点组进行并发测速,并展示带有即时延迟数据的节点列表供选择。
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# 切换节点 (支持别名: node, proxy, switch)
|
|
85
|
+
ck use
|
|
86
|
+
# 或者
|
|
87
|
+
ck switch
|
|
88
|
+
# 或者
|
|
89
|
+
ck node
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 5. 更多功能
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# 查看状态
|
|
96
|
+
ck info # 或者 ck status, ck view
|
|
97
|
+
|
|
98
|
+
# 节点并发测速 (仅测速不切换,支持别名: test, ls, t)
|
|
99
|
+
ck list # 或者 ck test, ck ls
|
|
100
|
+
|
|
101
|
+
# 设置系统代理
|
|
102
|
+
ck sys on
|
|
103
|
+
ck sys off
|
|
104
|
+
|
|
105
|
+
# 开启 TUN 模式 (需要 sudo 权限)
|
|
106
|
+
ck tun on # 开启
|
|
107
|
+
ck tun off # 关闭
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## 命令详解
|
|
111
|
+
|
|
112
|
+
| 命令 (别名) | 说明 | 示例 |
|
|
113
|
+
| ----------------------------- | -------------------------- | ------------------------------------------------------------------------ |
|
|
114
|
+
| `ck init` | 初始化内核及权限 | `ck init` |
|
|
115
|
+
| `ck on` (`start`) | 启动 Clash 服务 | `ck on` `ck on -s` (启动并设置系统代理) `ck on -t` (启动并开启 TUN 模式) |
|
|
116
|
+
| `ck off` (`stop`) | 停止服务并关闭代理 | `ck off` |
|
|
117
|
+
| `ck rs` (`restart`) | 重启 Clash 服务 | `ck rs` `ck rs -s` (重启并设置系统代理) `ck rs -t` (重启并开启 TUN 模式) |
|
|
118
|
+
| `ck info` (`status`, `view`) | 查看运行状态及当前节点延迟 | `ck info` / `ck status` / `ck view` |
|
|
119
|
+
| `ck sysproxy` (`sys`) | 设置系统代理 | `ck sys on` / `ck sys off` |
|
|
120
|
+
| `ck tun` | 设置 TUN 模式 (需要 sudo) | `ck tun on` |
|
|
121
|
+
| `ck sub` | 管理订阅(交互式)【推荐】 | `ck sub` |
|
|
122
|
+
| `ck sub -l` | 列出所有订阅 | `ck sub -l` |
|
|
123
|
+
| `ck sub -a <url>` | 添加订阅 | `ck sub -a "http..." -n "pro"` |
|
|
124
|
+
| `ck sub -u <name>` | 切换订阅 | `ck sub -u "pro"` |
|
|
125
|
+
| `ck use` (`node`, `switch`) | 切换节点 (自动测速) | `ck use` / `ck node` |
|
|
126
|
+
| `ck list` (`ls`, `test`, `t`) | 节点测速列表 (不切换) | `ck list` / `ck test` |
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
[MIT](./LICENSE).
|
|
131
|
+
|
|
132
|
+
开源不易,点赞鼓励!
|
|
133
|
+
点一个 Star⭐️ 支持我们~ 🌸Let's enjoy it!
|
package/bin/dns-helper
ADDED
|
Binary file
|
package/bin/index.js
CHANGED
|
@@ -1,86 +1,97 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { Command } from 'commander'
|
|
4
|
-
import { createRequire } from 'module'
|
|
5
|
-
import { init } from '../lib/commands/init.js'
|
|
6
|
-
import { start } from '../lib/commands/start.js'
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.
|
|
26
|
-
.
|
|
27
|
-
.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
.
|
|
33
|
-
.
|
|
34
|
-
.
|
|
35
|
-
.option('-
|
|
36
|
-
.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.
|
|
45
|
-
.
|
|
46
|
-
.
|
|
47
|
-
.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
program
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
.
|
|
58
|
-
.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
.
|
|
69
|
-
.description('
|
|
70
|
-
.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
.
|
|
79
|
-
.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import { createRequire } from 'module'
|
|
5
|
+
import { init } from '../lib/commands/init.js'
|
|
6
|
+
import { start } from '../lib/commands/start.js'
|
|
7
|
+
import { restart } from '../lib/commands/restart.js'
|
|
8
|
+
import { stop } from '../lib/commands/stop.js'
|
|
9
|
+
import { setSysProxy } from '../lib/commands/sysproxy.js'
|
|
10
|
+
import { setTun } from '../lib/commands/tun.js'
|
|
11
|
+
import { status } from '../lib/commands/status.js'
|
|
12
|
+
import { manageSub } from '../lib/commands/sub.js'
|
|
13
|
+
import { proxy } from '../lib/commands/proxy.js'
|
|
14
|
+
import { test } from '../lib/commands/test.js'
|
|
15
|
+
|
|
16
|
+
const require = createRequire(import.meta.url)
|
|
17
|
+
const pkg = require('../package.json')
|
|
18
|
+
|
|
19
|
+
const program = new Command()
|
|
20
|
+
|
|
21
|
+
program.name('clash').alias('ck').description('Clash CLI 管理工具 (Alias: ck)').version(pkg.version, '-v, --version')
|
|
22
|
+
|
|
23
|
+
// 初始化 clash 内核
|
|
24
|
+
program
|
|
25
|
+
.command('init')
|
|
26
|
+
.description('初始化 Clash 内核 (下载、解压并设置权限)')
|
|
27
|
+
.option('-f, --force', '强制重新下载内核')
|
|
28
|
+
.action(init)
|
|
29
|
+
|
|
30
|
+
// 启动 clash 服务
|
|
31
|
+
program
|
|
32
|
+
.command('on')
|
|
33
|
+
.alias('start')
|
|
34
|
+
.description('启动 Clash 服务, -s 自动开启系统代理, -t 自动开启 TUN 模式(全局代理)')
|
|
35
|
+
.option('-s, --sysproxy', '启动后自动开启系统代理')
|
|
36
|
+
.option('-t, --tun', '启动后自动开启 TUN 模式')
|
|
37
|
+
.action(start)
|
|
38
|
+
|
|
39
|
+
// 停止 clash 服务
|
|
40
|
+
program.command('off').alias('stop').description('停止 Clash 服务').action(stop)
|
|
41
|
+
|
|
42
|
+
// 重启 clash 服务
|
|
43
|
+
program
|
|
44
|
+
.command('restart')
|
|
45
|
+
.alias('re')
|
|
46
|
+
.alias('rs')
|
|
47
|
+
.description('重启 Clash 服务')
|
|
48
|
+
.option('-s, --sysproxy', '启动后自动开启系统代理')
|
|
49
|
+
.option('-t, --tun', '启动后自动开启 TUN 模式')
|
|
50
|
+
.action(restart)
|
|
51
|
+
|
|
52
|
+
// 设置系统代理
|
|
53
|
+
program
|
|
54
|
+
.command('sysproxy')
|
|
55
|
+
.alias('sys')
|
|
56
|
+
.description('设置系统代理')
|
|
57
|
+
.argument('[action]', 'on 或 off')
|
|
58
|
+
.action(setSysProxy)
|
|
59
|
+
|
|
60
|
+
// 设置 TUN 模式(真正的全局代理,所有流量都会被代理)
|
|
61
|
+
program.command('tun').description('设置 TUN 模式 (可能需要提权)').argument('[action]', 'on 或 off').action(setTun)
|
|
62
|
+
|
|
63
|
+
// 查看 clash 状态
|
|
64
|
+
program.command('info').alias('status').alias('view').description('查看 Clash 运行状态').action(status)
|
|
65
|
+
|
|
66
|
+
// 管理订阅
|
|
67
|
+
program
|
|
68
|
+
.command('sub')
|
|
69
|
+
.description('管理订阅')
|
|
70
|
+
.option('-a, --add <url>', '添加订阅链接')
|
|
71
|
+
.option('-n, --name <name>', '订阅名称')
|
|
72
|
+
.option('-l, --list', '列出所有订阅')
|
|
73
|
+
.option('-u, --use <name>', '切换使用的订阅')
|
|
74
|
+
.action(manageSub)
|
|
75
|
+
|
|
76
|
+
// 切换节点
|
|
77
|
+
program
|
|
78
|
+
.command('use')
|
|
79
|
+
.aliases(['node', 'proxy', 'switch'])
|
|
80
|
+
.description('切换节点 (别名: node, proxy, switch)')
|
|
81
|
+
.action(proxy)
|
|
82
|
+
|
|
83
|
+
// 列出所有节点,并测速
|
|
84
|
+
program
|
|
85
|
+
.command('list')
|
|
86
|
+
.alias('ls')
|
|
87
|
+
.alias('test')
|
|
88
|
+
.alias('t')
|
|
89
|
+
.description('节点测速 (别名: list, ls, test, t) ')
|
|
90
|
+
.action(test)
|
|
91
|
+
|
|
92
|
+
// Support -V for version
|
|
93
|
+
if (process.argv.includes('-V')) {
|
|
94
|
+
process.argv[process.argv.indexOf('-V')] = '-v'
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
program.parse(process.argv)
|
package/default.yaml
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
# HTTP 代理端口
|
|
2
|
-
port: 7890
|
|
3
|
-
# SOCKS5 代理端口
|
|
4
|
-
socks-port: 7891
|
|
5
|
-
# 允许局域网连接
|
|
6
|
-
allow-lan: true
|
|
7
|
-
|
|
8
|
-
# 规则模式:Rule(规则) / Global(全局)/ Direct(直连)
|
|
9
|
-
mode: Rule
|
|
10
|
-
# 日志级别:info / warning / error / debug / silent
|
|
11
|
-
log-level: info
|
|
12
|
-
# 外部控制接口(用于 Dashboard)
|
|
13
|
-
external-controller: 127.0.0.1:9090
|
|
14
|
-
|
|
15
|
-
# 代理节点定义 (示例)
|
|
16
|
-
proxies:
|
|
17
|
-
# - name: "Shadowsocks 示例"
|
|
18
|
-
# type: ss
|
|
19
|
-
# server: server
|
|
20
|
-
# port: 443
|
|
21
|
-
# cipher: chacha20-ietf-poly1305
|
|
22
|
-
# password: "password"
|
|
23
|
-
|
|
24
|
-
# - name: "Vmess 示例"
|
|
25
|
-
# type: vmess
|
|
26
|
-
# server: server
|
|
27
|
-
# port: 443
|
|
28
|
-
# uuid: uuid
|
|
29
|
-
# alterId: 64
|
|
30
|
-
# cipher: auto
|
|
31
|
-
|
|
32
|
-
# 代理组定义
|
|
33
|
-
proxy-groups:
|
|
34
|
-
- name: PROXY
|
|
35
|
-
type: select
|
|
36
|
-
proxies:
|
|
37
|
-
- DIRECT
|
|
38
|
-
# - "Shadowsocks 示例"
|
|
39
|
-
|
|
40
|
-
# 规则定义
|
|
41
|
-
rules:
|
|
42
|
-
- DOMAIN-SUFFIX,google.com,PROXY
|
|
43
|
-
- DOMAIN-KEYWORD,google,PROXY
|
|
44
|
-
- DOMAIN,google.com,PROXY
|
|
45
|
-
- GEOIP,CN,DIRECT
|
|
46
|
-
- MATCH,PROXY
|
|
1
|
+
# HTTP 代理端口
|
|
2
|
+
port: 7890
|
|
3
|
+
# SOCKS5 代理端口
|
|
4
|
+
socks-port: 7891
|
|
5
|
+
# 允许局域网连接
|
|
6
|
+
allow-lan: true
|
|
7
|
+
|
|
8
|
+
# 规则模式:Rule(规则) / Global(全局)/ Direct(直连)
|
|
9
|
+
mode: Rule
|
|
10
|
+
# 日志级别:info / warning / error / debug / silent
|
|
11
|
+
log-level: info
|
|
12
|
+
# 外部控制接口(用于 Dashboard)
|
|
13
|
+
external-controller: 127.0.0.1:9090
|
|
14
|
+
|
|
15
|
+
# 代理节点定义 (示例)
|
|
16
|
+
proxies:
|
|
17
|
+
# - name: "Shadowsocks 示例"
|
|
18
|
+
# type: ss
|
|
19
|
+
# server: server
|
|
20
|
+
# port: 443
|
|
21
|
+
# cipher: chacha20-ietf-poly1305
|
|
22
|
+
# password: "password"
|
|
23
|
+
|
|
24
|
+
# - name: "Vmess 示例"
|
|
25
|
+
# type: vmess
|
|
26
|
+
# server: server
|
|
27
|
+
# port: 443
|
|
28
|
+
# uuid: uuid
|
|
29
|
+
# alterId: 64
|
|
30
|
+
# cipher: auto
|
|
31
|
+
|
|
32
|
+
# 代理组定义
|
|
33
|
+
proxy-groups:
|
|
34
|
+
- name: PROXY
|
|
35
|
+
type: select
|
|
36
|
+
proxies:
|
|
37
|
+
- DIRECT
|
|
38
|
+
# - "Shadowsocks 示例"
|
|
39
|
+
|
|
40
|
+
# 规则定义
|
|
41
|
+
rules:
|
|
42
|
+
- DOMAIN-SUFFIX,google.com,PROXY
|
|
43
|
+
- DOMAIN-KEYWORD,google,PROXY
|
|
44
|
+
- DOMAIN,google.com,PROXY
|
|
45
|
+
- GEOIP,CN,DIRECT
|
|
46
|
+
- MATCH,PROXY
|