clash-kit 1.1.1 → 1.1.5

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 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,126 +1,159 @@
1
- # Clash Kit
2
-
3
- 一个基于 Node.js Clash 命令行管理工具,旨在简化 Clash 的配置管理、订阅切换和节点测速等操作。
4
-
5
- 目前已兼容 Windows,MacOs,Linux。
6
-
7
- ## 截图
8
-
9
- <img width="1920" alt="image" src="https://github.com/user-attachments/assets/1183f778-62b0-4ac7-ab55-b821b66161f0" />
10
-
11
- ## 特性
12
-
13
- - 🔄 **订阅管理**:支持添加、切换多个订阅源。
14
- - 🌐 **节点切换**:交互式选择并切换当前使用的代理节点。
15
- - 🔥 **热重载**:切换订阅后立即生效,无需重启服务。
16
- - **节点测速**:支持多线程并发测速,彩色高亮显示延迟结果。
17
- - 📊 **状态监控**:实时查看服务运行状态、当前节点及延迟。
18
- - 🛠 **自动初始化**:自动处理二进制文件权限问题。
19
-
20
- - 💻 **系统代理**:一键开启/关闭 macOS 系统 HTTP 代理。
21
- - 🛡 **TUN 模式**:高级网络模式,接管系统所有流量(真 · 全局代理)。
22
-
23
- ## 使用
24
-
25
- ### 1. 安装
26
-
27
- ```bash
28
- npm install -g clash-kit
29
- # 或者
30
- pnpm add -g clash-kit
31
- ```
32
-
33
- ### 2. 初始化
34
-
35
- 首次安装后,需要先初始化 Clash 内核与权限:
36
-
37
- ```bash
38
- clash init
39
- # 推荐用简化命令(文档后续均以简化命令为例)
40
- ck init
41
- ```
42
-
43
- ### 3. 添加订阅
44
-
45
- ```bash
46
- # 交互式管理订阅(添加、切换、删除等)【推荐使用这种方式来管理订阅】
47
- ck sub
48
-
49
- # 列出所有订阅
50
- ck sub -l
51
-
52
- # 手动添加订阅
53
- ck sub -a "https://example.com/subscribe?token=xxx" -n "abcName"
54
- ```
55
-
56
- ### 4. 启动服务
57
-
58
- 启动 Clash 核心服务(建议在一个单独的终端窗口运行):
59
-
60
- ```bash
61
- # 启动 Clash 代理服务
62
- ck on # 或者 ck start
63
-
64
- # 启动并自动开启系统代理
65
- ck on -s
66
- # 启动并自动开启 TUN 模式(全局代理, 需要 sudo 权限)
67
- ck on -t
68
-
69
- # 关闭服务并关闭系统代理
70
- ck off # 或者 ck stop
71
- ```
72
-
73
- ### 4. 节点切换(自动测速)
74
-
75
- 进入交互式界面,自动对当前节点组进行并发测速,并展示带有即时延迟数据的节点列表供选择。
76
-
77
- ```bash
78
- # 切换节点 (支持别名: node, proxy, switch)
79
- ck use
80
- # 或者
81
- ck switch
82
- # 或者
83
- ck node
84
- ```
85
-
86
- ### 5. 更多功能
87
-
88
- ```bash
89
- # 查看状态
90
- ck info # 或者 ck status, ck view
91
-
92
- # 节点并发测速 (仅测速不切换,支持别名: test, ls, t)
93
- ck list # 或者 ck test, ck ls
94
-
95
- # 设置系统代理
96
- ck sys on
97
- ck sys off
98
-
99
- # 开启 TUN 模式 (需要 sudo 权限)
100
- ck tun on # 开启
101
- ck tun off # 关闭
102
- ```
103
-
104
- ## 命令详解
105
-
106
- | 命令 (别名) | 说明 | 示例 |
107
- | ----------------------------- | -------------------------- | ------------------------------------------------------------------------ |
108
- | `ck init` | 初始化内核及权限 | `ck init` |
109
- | `ck on` (`start`) | 启动 Clash 服务 | `ck on` `ck on -s` (启动并设置系统代理) `ck on -t` (启动并开启 TUN 模式) |
110
- | `ck off` (`stop`) | 停止服务并关闭代理 | `ck off` |
111
- | `ck info` (`status`, `view`) | 查看运行状态及当前节点延迟 | `ck info` / `ck status` / `ck view` |
112
- | `ck sysproxy` (`sys`) | 设置系统代理 | `ck sys on` / `ck sys off` |
113
- | `ck tun` | 设置 TUN 模式 (需要 sudo) | `ck tun on` |
114
- | `ck sub` | 管理订阅(交互式)【推荐】 | `ck sub` |
115
- | `ck sub -l` | 列出所有订阅 | `ck sub -l` |
116
- | `ck sub -a <url>` | 添加订阅 | `ck sub -a "http..." -n "pro"` |
117
- | `ck sub -u <name>` | 切换订阅 | `ck sub -u "pro"` |
118
- | `ck use` (`node`, `switch`) | 切换节点 (自动测速) | `ck use` / `ck node` |
119
- | `ck list` (`ls`, `test`, `t`) | 节点测速列表 (不切换) | `ck list` / `ck test` |
120
-
121
- ## License
122
-
123
- [MIT](./LICENSE).
124
-
125
- 开源不易,点赞鼓励!
126
- 点一个 Star⭐️ 支持我们~ 🌸Let's enjoy it!
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
+ <img width="604" height="315" alt="image" src="https://github.com/user-attachments/assets/7c97ef51-5a95-4612-aa43-ce66423d7560" />
11
+
12
+ ## 特性
13
+
14
+ - 🔄 **订阅管理**:支持添加、切换、修改、删除多个订阅源。
15
+ - 🌐 **节点切换**:交互式选择并切换当前使用的代理节点。
16
+ - 🔥 **热重载**:切换订阅/开关 TUN 后立即生效,无需重启服务。
17
+ - **节点测速**:支持多线程并发测速,彩色高亮显示延迟结果。
18
+ - 📊 **状态监控**:实时查看服务运行状态、当前节点及延迟。
19
+ - 🛠 **自动初始化**:自动处理二进制文件权限问题。
20
+
21
+ - 💻 **系统代理**:一键开启/关闭 macOS 系统 HTTP 代理。
22
+ - 🛡 **TUN 模式**:高级网络模式,接管系统所有流量(真 · 全局代理)。
23
+
24
+ ## 安装
25
+
26
+ - 支持通过 npm 或其它任意包管理器全局安装:
27
+
28
+ ```bash
29
+ npm install -g clash-kit
30
+ # 或者
31
+ pnpm add -g clash-kit
32
+ # 或者
33
+ yarn global add clash-kit
34
+ ```
35
+
36
+ - 也支持通过 Homebrew 安装:
37
+
38
+ ```bash
39
+ # 1. 先通过 brew tap 添加仓库
40
+ brew tap wangrongding/clash-kit https://github.com/wangrongding/clash-kit
41
+ # 2. 安装 clash-kit
42
+ brew install clash-kit
43
+ ```
44
+
45
+ ## 使用
46
+
47
+ ### 1. 初始化
48
+
49
+ 首次安装后,需要先初始化 Clash 内核与权限:
50
+
51
+ ```bash
52
+ # 推荐用简化命令(文档后续均以简化命令为例)
53
+ ck init # 或者 clash init
54
+ ```
55
+
56
+ ### 3. 管理订阅
57
+
58
+ ```bash
59
+ # 交互式管理订阅(添加、切换、修改、删除)【推荐】
60
+ ck sub
61
+
62
+ # 列出所有订阅
63
+ ck sub -l
64
+
65
+ # 手动添加订阅(-n 名称,-a 链接)
66
+ ck sub -n "test123" -a "https://example.com/subscribe?token=xxx"
67
+
68
+ # 手动切换订阅
69
+ ck sub -u "test123"
70
+ ```
71
+
72
+ 交互式模式 (`ck sub`) 提供以下操作:
73
+
74
+ | 操作 | 说明 |
75
+ | -------- | ------------------------------------------ |
76
+ | 切换订阅 | 从现有订阅中选择并立即生效(热重载) |
77
+ | 添加订阅 | 依次输入名称和链接,完成下载 |
78
+ | 修改订阅 | 重命名 和/或 更换订阅链接(均可留空跳过) |
79
+ | 删除订阅 | 选择后需二次确认,若删除当前订阅会自动解绑 |
80
+
81
+ ### 4. 启动服务
82
+
83
+ 启动 Clash 核心服务(建议在一个单独的终端窗口运行):
84
+
85
+ ```bash
86
+ # 启动 Clash 代理服务
87
+ ck on # 或者 ck start
88
+
89
+ # 启动并自动开启系统代理
90
+ ck on -s
91
+ # 启动并自动开启 TUN 模式(全局代理, 需要 sudo 权限)
92
+ ck on -t
93
+ ```
94
+
95
+ ### 5. 关闭服务 或 重新启动服务
96
+
97
+ ```bash
98
+ # 关闭服务
99
+ ck off # 或者 ck stop
100
+
101
+ # 重新启动服务
102
+ ck rs # 或者 ck restart
103
+ ```
104
+
105
+ ### 6. 节点切换(自动测速)
106
+
107
+ 进入交互式界面,自动对当前节点组进行并发测速,并展示带有即时延迟数据的节点列表供选择。
108
+
109
+ ```bash
110
+ # 切换节点 (支持别名: node, proxy, switch)
111
+ ck use
112
+ ```
113
+
114
+ ### 7. 更多功能
115
+
116
+ ```bash
117
+ # 查看状态
118
+ ck info # 或者 ck status, ck view
119
+
120
+ # 节点并发测速 (仅测速不切换,支持别名: test, ls, t)
121
+ ck ls # 或者 ck list,ck test,ck t
122
+
123
+ # 设置系统代理
124
+ ck sys on
125
+ ck sys off
126
+
127
+ # 开启 TUN 模式 (需要 sudo 权限)
128
+ ck tun on # 开启
129
+ ck tun off # 关闭
130
+ ```
131
+
132
+ ## 命令详解
133
+
134
+ | 命令 (别名) | 说明 | 示例 |
135
+ | ----------------------------- | -------------------------- | ------------------------------------------------------------------------ |
136
+ | `ck init` | 初始化内核及权限 | `ck init` |
137
+ | `ck on` (`start`) | 启动 Clash 服务 | `ck on` `ck on -s` (启动并设置系统代理) `ck on -t` (启动并开启 TUN 模式) |
138
+ | `ck off` (`stop`) | 停止服务并关闭代理 | `ck off` |
139
+ | `ck rs` (`restart`) | 重启 Clash 服务 | `ck rs` `ck rs -s` (重启并设置系统代理) `ck rs -t` (重启并开启 TUN 模式) |
140
+ | `ck info` (`status`, `view`) | 查看运行状态及当前节点延迟 | `ck info` / `ck status` / `ck view` |
141
+ | `ck sysproxy` (`sys`) | 设置系统代理 | `ck sys on` / `ck sys off` |
142
+ | `ck tun` | 设置 TUN 模式 (需要 sudo) | `ck tun on` / `ck tun off` |
143
+ | `ck sub` | 管理订阅(交互式)【推荐】 | `ck sub` |
144
+ | `ck sub -l` | 列出所有订阅 | `ck sub -l` |
145
+ | `ck sub -n <name> -a <url>` | 添加订阅 | `ck sub -n "pro" -a "http..."` |
146
+ | `ck sub -u <name>` | 切换订阅 | `ck sub -u "pro"` |
147
+ | `ck use` (`node`, `switch`) | 切换节点 (自动测速) | `ck use` / `ck node` |
148
+ | `ck list` (`ls`, `test`, `t`) | 节点测速列表 (不切换) | `ck list` / `ck test` |
149
+
150
+ ## 截图
151
+
152
+ <img width="1920" alt="image" src="https://github.com/user-attachments/assets/1183f778-62b0-4ac7-ab55-b821b66161f0" />
153
+
154
+ ## License
155
+
156
+ [MIT](./LICENSE).
157
+
158
+ 开源不易,点赞鼓励!
159
+ 点一个 Star⭐️ 支持我们~ 🌸Let's enjoy it!
package/bin/index.js CHANGED
@@ -1,86 +1,114 @@
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 { stop } from '../lib/commands/stop.js'
8
- import { setSysProxy } from '../lib/commands/sysproxy.js'
9
- import { setTun } from '../lib/commands/tun.js'
10
- import { status } from '../lib/commands/status.js'
11
- import { manageSub } from '../lib/commands/sub.js'
12
- import { proxy } from '../lib/commands/proxy.js'
13
- import { test } from '../lib/commands/test.js'
14
-
15
- const require = createRequire(import.meta.url)
16
- const pkg = require('../package.json')
17
-
18
- const program = new Command()
19
-
20
- program.name('clash').alias('ck').description('Clash CLI 管理工具 (Alias: ck)').version(pkg.version, '-v, --version')
21
-
22
- // 初始化 clash 内核
23
- program
24
- .command('init')
25
- .description('初始化 Clash 内核 (下载、解压并设置权限)')
26
- .option('-f, --force', '强制重新下载内核')
27
- .action(init)
28
-
29
- // 启动 clash 服务
30
- program
31
- .command('on')
32
- .alias('start')
33
- .description('启动 Clash 服务, -s 自动开启系统代理, -t 自动开启 TUN 模式(全局代理)')
34
- .option('-s, --sysproxy', '启动后自动开启系统代理')
35
- .option('-t, --tun', '启动后自动开启 TUN 模式')
36
- .action(start)
37
-
38
- // 停止 clash 服务
39
- program.command('off').alias('stop').description('停止 Clash 服务').action(stop)
40
-
41
- // 设置系统代理
42
- program
43
- .command('sysproxy')
44
- .alias('sys')
45
- .description('设置系统代理')
46
- .argument('[action]', 'on off')
47
- .action(setSysProxy)
48
-
49
- // 设置 TUN 模式(真正的全局代理,所有流量都会被代理)
50
- program.command('tun').description('设置 TUN 模式 (可能需要提权)').argument('[action]', 'on 或 off').action(setTun)
51
-
52
- // 查看 clash 状态
53
- program.command('info').alias('status').alias('view').description('查看 Clash 运行状态').action(status)
54
-
55
- // 管理订阅
56
- program
57
- .command('sub')
58
- .description('管理订阅')
59
- .option('-a, --add <url>', '添加订阅链接')
60
- .option('-n, --name <name>', '订阅名称')
61
- .option('-l, --list', '列出所有订阅')
62
- .option('-u, --use <name>', '切换使用的订阅')
63
- .action(manageSub)
64
-
65
- // 切换节点
66
- program
67
- .command('use')
68
- .aliases(['node', 'proxy', 'switch'])
69
- .description('切换节点 (别名: node, proxy, switch)')
70
- .action(proxy)
71
-
72
- // 列出所有节点,并测速
73
- program
74
- .command('list')
75
- .alias('ls')
76
- .alias('test')
77
- .alias('t')
78
- .description('节点测速 (别名: list, ls, test, t) ')
79
- .action(test)
80
-
81
- // Support -V for version
82
- if (process.argv.includes('-V')) {
83
- process.argv[process.argv.indexOf('-V')] = '-v'
84
- }
85
-
86
- program.parse(process.argv)
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
+ import updateNotifier from 'update-notifier'
16
+
17
+ const require = createRequire(import.meta.url)
18
+ const pkg = require('../package.json')
19
+
20
+ updateNotifier({
21
+ pkg: pkg,
22
+ updateCheckInterval: 1000 * 60 * 60 * 24, // 检查更新间隔,1 day
23
+ shouldNotifyInNpmScript: true,
24
+ }).notify({
25
+ isGlobal: true,
26
+ boxenOptions: {
27
+ title: '有新版本的 Clash Kit 可用',
28
+ padding: 1,
29
+ margin: 1,
30
+ align: 'center',
31
+ borderColor: 'yellowBright',
32
+ borderStyle: 'round',
33
+ },
34
+ })
35
+ const program = new Command()
36
+
37
+ program.name('clash').alias('ck').description('Clash CLI 管理工具 (Alias: ck)').version(pkg.version, '-v, --version')
38
+
39
+ // 初始化 clash 内核
40
+ program
41
+ .command('init')
42
+ .description('初始化 Clash 内核 (下载、解压并设置权限)')
43
+ .option('-f, --force', '强制重新下载内核')
44
+ .action(init)
45
+
46
+ // 启动 clash 服务
47
+ program
48
+ .command('on')
49
+ .alias('start')
50
+ .description('启动 Clash 服务, -s 自动开启系统代理, -t 自动开启 TUN 模式(全局代理)')
51
+ .option('-s, --sysproxy', '启动后自动开启系统代理')
52
+ .option('-t, --tun', '启动后自动开启 TUN 模式')
53
+ .action(start)
54
+
55
+ // 停止 clash 服务
56
+ program.command('off').alias('stop').description('停止 Clash 服务').action(stop)
57
+
58
+ // 重启 clash 服务
59
+ program
60
+ .command('restart')
61
+ .alias('re')
62
+ .alias('rs')
63
+ .description('重启 Clash 服务')
64
+ .option('-s, --sysproxy', '启动后自动开启系统代理')
65
+ .option('-t, --tun', '启动后自动开启 TUN 模式')
66
+ .action(restart)
67
+
68
+ // 设置系统代理
69
+ program
70
+ .command('sysproxy')
71
+ .alias('sys')
72
+ .description('设置系统代理')
73
+ .argument('[action]', 'on 或 off')
74
+ .action(setSysProxy)
75
+
76
+ // 设置 TUN 模式(真正的全局代理,所有流量都会被代理)
77
+ program.command('tun').description('设置 TUN 模式 (可能需要提权)').argument('[action]', 'on 或 off').action(setTun)
78
+
79
+ // 查看 clash 状态
80
+ program.command('info').alias('status').alias('view').description('查看 Clash 运行状态').action(status)
81
+
82
+ // 管理订阅
83
+ program
84
+ .command('sub')
85
+ .description('管理订阅')
86
+ .option('-a, --add <url>', '添加订阅链接')
87
+ .option('-n, --name <name>', '订阅名称')
88
+ .option('-l, --list', '列出所有订阅')
89
+ .option('-u, --use <name>', '切换使用的订阅')
90
+ .option('-d, --delete <name>', '删除订阅')
91
+ .action(manageSub)
92
+
93
+ // 切换节点
94
+ program
95
+ .command('use')
96
+ .aliases(['node', 'proxy', 'switch'])
97
+ .description('切换节点 (别名: node, proxy, switch)')
98
+ .action(proxy)
99
+
100
+ // 列出所有节点,并测速
101
+ program
102
+ .command('list')
103
+ .alias('ls')
104
+ .alias('test')
105
+ .alias('t')
106
+ .description('节点测速 (别名: list, ls, test, t) ')
107
+ .action(test)
108
+
109
+ // Support -V for version
110
+ if (process.argv.includes('-V')) {
111
+ process.argv[process.argv.indexOf('-V')] = '-v'
112
+ }
113
+
114
+ 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