dsh-clash-subscription 0.12.0 → 0.13.0
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/CHANGELOG-0.13.0.md +156 -0
- package/README.md +3 -3
- package/client.js +10 -16
- package/index.js +94 -33
- package/lib/routes.js +7 -13
- package/lib/skill.js +1 -1
- package/package.json +5 -4
- package/CHANGELOG-0.12.0.md +0 -159
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# 0.13.0 · 测速只剩两个按钮,而且测速就带可用性
|
|
2
|
+
|
|
3
|
+
> 上一版 `0.12.0` · 本版 `0.13.0`
|
|
4
|
+
|
|
5
|
+
## 症状
|
|
6
|
+
|
|
7
|
+
面板上一个横排四个按钮:**立即重测**、**测全部节点**、**立刻检测当前节点**、**按能力重挑节点**。
|
|
8
|
+
|
|
9
|
+
四个里三个都叫「测」,但干的事不一样:
|
|
10
|
+
|
|
11
|
+
- 点「立即重测」,节点列表里的延迟数字变了,**可用 / 限流 / 受限 却一动不动**——想看一眼某个节点到底是慢还是坏,得再点另一个按钮。
|
|
12
|
+
- 「立刻检测当前节点」和「按能力重挑节点」听起来是两件事,实际都落到同一轮真实探测上,区别只在切不切节点。
|
|
13
|
+
- 用户得先记住「哪个按钮会写哪一列」,否则看到的是半张表。
|
|
14
|
+
|
|
15
|
+
这四行字背后的真实问题是:**同一个「测」字被三条不同的测量代码路径实现了**,而其中只有一条会把结论写进列表。
|
|
16
|
+
|
|
17
|
+
## 根因:`nodeDelays()` 拿不到可用性
|
|
18
|
+
|
|
19
|
+
面板表格的两列来自两个不同的地方:
|
|
20
|
+
|
|
21
|
+
| 列 | 来源 | 谁写 |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| 延迟 | `runtime.measured` | `nodeDelays()`、`healthRound()`、`runSurveyTick()` |
|
|
24
|
+
| 可用 / 限流 / 受限 | `runtime.healthRows` | **只有** `healthRound()`、`switchAfterStrikes()`、`runSurveyTick()` |
|
|
25
|
+
|
|
26
|
+
而「立即重测」走的 `nodeDelays()`,每节点调的是:
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
// lib/core.js · 0.12.0
|
|
30
|
+
async capabilities(name, probes, options) → { [probeId]: 毫秒数 | null }
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**纯数字**。没有 `state`、没有 `ok`、没有 `reason`——`judgeNodeHealth()` 要的东西一个都没有。所以这条路径天生只能写延迟,`healthRows` 从头到尾没被碰过:
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
// index.js · 0.12.0 nodeDelays()
|
|
37
|
+
this.measured = measured
|
|
38
|
+
this.lastMatrix = [...capability.values()]
|
|
39
|
+
this.measuredAt = Date.now()
|
|
40
|
+
return Object.fromEntries(measured) // 到此为止,healthRows 一行都没写
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
要拿到三态,必须走真实探针那套:`core.probeNodeReal()` / `core.realMatrix()` 返回的是
|
|
44
|
+
`{ id, state, ok, reason, ms, status, remaining, resetAt }`,再由 `judgeNodeHealth()` 汇总成
|
|
45
|
+
`{ usable, degraded, limited, blocked, failed }`。
|
|
46
|
+
|
|
47
|
+
## 改法一:面板只留两个按钮
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
当前节点测试 → action=test { current: true } 测正在跑流量的那个节点
|
|
51
|
+
全部节点测试 → action=test { all: true } 测订阅里的每一个节点
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
「立刻检测当前节点」与「按能力重挑节点」两个按钮一起删掉,MCP 工具的 `action=health` /
|
|
55
|
+
`action=reselect` 也一起下线(HTTP 路由里两个分支整段删除,现在传这两个动作会得到
|
|
56
|
+
`400 unknown action`)。
|
|
57
|
+
|
|
58
|
+
删的是**入口**,不是能力:
|
|
59
|
+
|
|
60
|
+
- `healthRound()` 保留——自动测速这一轮就是它,删了定时器就没了。
|
|
61
|
+
- `autoReselect()` 保留——它是 `healthRound({force:true})` 的薄包装,历史测试直接断言它。
|
|
62
|
+
- `describeHealth()` 保留——报告渲染还在用。
|
|
63
|
+
|
|
64
|
+
## 改法二:新增 `testNodes()`,一次测出延迟和结论
|
|
65
|
+
|
|
66
|
+
两个按钮共用一个入口,`Runtime.testNodes(options)`:
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
const plan = this.probePlan() // { probes, gating, specs }
|
|
70
|
+
const matrix = await this.core.realMatrix({
|
|
71
|
+
nodes, // 当前节点 / 指定节点 / 全部
|
|
72
|
+
specs: plan.specs,
|
|
73
|
+
gating: plan.gating,
|
|
74
|
+
delays: this.measured, // 已知延迟的先用,快的排前面
|
|
75
|
+
budgetMs, // min(selectBudgetMs, 300 s)
|
|
76
|
+
timeoutMs: this.config.probeTimeoutMs ?? 8000,
|
|
77
|
+
})
|
|
78
|
+
for (const row of matrix.rows) {
|
|
79
|
+
this.healthRows.set(row.name, { results: row.results, verdict: row.verdict, at })
|
|
80
|
+
const fastest = Math.min(...Object.values(row.results).filter(r => r?.ok === true && typeof r?.ms === 'number').map(r => r.ms))
|
|
81
|
+
if (Number.isFinite(fastest)) this.measured.set(row.name, fastest)
|
|
82
|
+
}
|
|
83
|
+
const rows = this.buildRealRows(nodes) // 和 status 用的是同一个映射
|
|
84
|
+
return { state: 'ok', rows, tested, skipped, total, summary: summariseRows(rows) }
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
三个刻意的选择:
|
|
88
|
+
|
|
89
|
+
1. **串行,不是并发。** `probeNodeReal()` 先 `selectProbe(name)` 把 `PROBE` 组指到某个节点,
|
|
90
|
+
而 `PROBE` 组同一时刻只能指一个——并发测就是在互相抢指针,测出来的结论会串。所以这里
|
|
91
|
+
和 `runSurveyTick()` 一样串行跑,用预算而不是并发控制时长。
|
|
92
|
+
2. **延迟不再单独测一遍。** `realMatrix` 已经把 gating 探针都跑完了,每一行都带着
|
|
93
|
+
`ms`;再从这些结果里取最快的一次当延迟,等于省掉一次完整的 `delay()` 往返。
|
|
94
|
+
3. **写的是 `buildRealRows()`。** 面板读 `status.nodeRows.rows`,那是 `buildRealRows()` 的输出;
|
|
95
|
+
测完直接用它组装返回,面板看到的形状和它轮询拿到的一模一样,不会出现「测的时候有、刷新后没了」。
|
|
96
|
+
|
|
97
|
+
## 自动测速没有改,因为它本来就是对的
|
|
98
|
+
|
|
99
|
+
需求是「发现当前节点有问题,立即连测三次,不受间隔限制,三次都有问题就切走」。
|
|
100
|
+
`healthRound()` 从 0.11.0 起就是这么写的:
|
|
101
|
+
|
|
102
|
+
```js
|
|
103
|
+
const attempts = Math.max(1, Number(this.config.healthAttempts ?? 3)) // 默认 3
|
|
104
|
+
for (let attempt = 1; attempt <= attempts; attempt += 1) {
|
|
105
|
+
const measured = await this.measureNode(current, plan) // 三次之间没有任何定时器
|
|
106
|
+
if (clean === true) return report // 一次干净就结束
|
|
107
|
+
}
|
|
108
|
+
return await this.switchAfterStrikes(report, plan, options) // 三次都不干净才找替代
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
这一次只补了**断言**:`test/regression-0130.mjs` 第 6 节用一个假内核记录每次调用的时间戳,
|
|
112
|
+
然后断言 `attempts.length === 3` 且相邻两次间隔 `< 200 ms`(实测 0,0 ms)——把
|
|
113
|
+
「不受间隔限制」这句话变成可复跑的判据,而不是继续写在注释里。
|
|
114
|
+
|
|
115
|
+
### 预算:真机上 50 多个节点测不完怎么办
|
|
116
|
+
|
|
117
|
+
「全部节点测试」是**串行真探针**,一个节点要跑 gstatic / GitHub / git 三条真实请求,
|
|
118
|
+
失败还要退避重试。真机实测:订阅 55 个节点、其中大部分是死节点,45 秒预算只测完 4 个。
|
|
119
|
+
所以 `testNodes()` 的返回里既有 `rows`(整张表,没测到的显示「未测」),也有 `skipped`
|
|
120
|
+
(这一轮预算没轮到的节点名)。**没测到不等于坏**,面板显示「未测」,不会当成不可用。
|
|
121
|
+
|
|
122
|
+
延迟不用等这一轮:`/clash-proxy/status` 发现 `measured` 为空时会在后台补一次
|
|
123
|
+
`nodeDelays()`,那是廉价的健康检查通道,几秒就能把能应答的节点延迟填上。所以「全部节点
|
|
124
|
+
测试」跑完的观感是:测过的节点带三态结论,其余节点先有延迟、结论仍是「未测」。
|
|
125
|
+
|
|
126
|
+
## 验收
|
|
127
|
+
|
|
128
|
+
`test/regression-0130.mjs`(55 assertions,全绿)分八节:
|
|
129
|
+
|
|
130
|
+
| 节 | 断言的是什么 |
|
|
131
|
+
|---|---|
|
|
132
|
+
| 1 | `{current:true}` 只把当前节点交给矩阵,延迟取最快的那次(120,而不是 180),`healthRows` / `measured` 都写 |
|
|
133
|
+
| 2 | `{all:true}` 三态各自归位(ok / limited / blocked),**受限的节点也带延迟**,`summary` 各计 1 |
|
|
134
|
+
| 3 | `only` 指定节点、不存在的名字回 `no-node`、并发时回 `in-flight`、内核没跑回 `core-not-running` |
|
|
135
|
+
| 4 | 走真实路由:`test+current` 回整份 `rows`(不只是 delays);`health` / `reselect` 得到 `400 unknown action` |
|
|
136
|
+
| 5 | 走真实工具:enum 里没有 health / reselect,`action=test` 的 summary 是「名字 N ms:可用」 |
|
|
137
|
+
| 6 | 自动轮:A 连败三次后切到 B,三次间隔 0,0 ms |
|
|
138
|
+
| 7 | 面板源码:正好两个测速按钮(current + all),中英文案,四个旧键删干净 |
|
|
139
|
+
| 8 | 插件自带技能:不再教 `action=health`,改成 `action=test` |
|
|
140
|
+
|
|
141
|
+
另外四套旧回归复跑:`regression-0120` 27 / `regression-070` 134 / `regression-0100` 48 /
|
|
142
|
+
`regression-063` 29,全部 0 failed。`test/e2e-0130.mjs`(真内核 + 真订阅):当前节点测出
|
|
143
|
+
真实延迟与三态,全部节点测出多行,`status.nodeRows` 拿到的就是这些行。
|
|
144
|
+
|
|
145
|
+
## 影响面
|
|
146
|
+
|
|
147
|
+
- **面板**:四个按钮变两个;设置页与节点行内的 ⟳ 不变。
|
|
148
|
+
- **MCP 工具**:`clash_proxy` 的 `action` 少了 `health` 与 `reselect`;`action=test` 现在回
|
|
149
|
+
`{ rows, tested, skipped, total, summary }`,不再只是 `{ delays }`。原来读 `delays` 的调用方
|
|
150
|
+
改读 `rows`(每行 `{ name, delay, usable }`)。
|
|
151
|
+
- **HTTP 路由**:`POST /clash-proxy/action` 的 `test` 支持 `current` / `all` / `node` 三种范围。
|
|
152
|
+
- **配置**:没有新增键,升级不需要改配置。
|
|
153
|
+
|
|
154
|
+
## 升级
|
|
155
|
+
|
|
156
|
+
装完要**完全退出 DSH 再打开**——宿主进程里跑的是旧模块,面板不会自己变。
|
package/README.md
CHANGED
|
@@ -200,8 +200,8 @@ Settings → **Clash proxy**:
|
|
|
200
200
|
|
|
201
201
|
- live state: endpoint, whether the policy is installed, and whether it is actually healthy
|
|
202
202
|
- one row per subscription: name, node count, last fetch time, its own refresh button
|
|
203
|
-
- exit-node table with per-node latency (
|
|
204
|
-
-
|
|
203
|
+
- exit-node table with per-node **latency and usability** (可用 / 限流 / 受限 / 未测), written by whichever test ran last
|
|
204
|
+
- exactly **two** test buttons: **当前节点测试** (the node carrying traffic) and **全部节点测试** (the whole subscription). Both measure latency *and* usability in one pass, and both write what they measured into the node table — there is no separate "check health" or "re-pick by capability" button any more
|
|
205
205
|
- when no core is present: a **下载内核** button, with the download's progress and outcome
|
|
206
206
|
|
|
207
207
|
## Tool
|
|
@@ -214,7 +214,7 @@ Settings → **Clash proxy**:
|
|
|
214
214
|
| `import` | `url` (one or more lines) replaces the list; `append: true` adds. Probes, **saves**, restarts |
|
|
215
215
|
| `bootstrap` | Download and verify a core when this platform has no bundled one |
|
|
216
216
|
| `start` / `stop` | Bring routing up (unpacking the bundled core if needed) / return to direct |
|
|
217
|
-
| `select` / `test` | Switch the exit node / measure latency |
|
|
217
|
+
| `select` / `test` | Switch the exit node / measure **latency and usability** for the current node, one named node (`node`), or every node. The result is what the panel table shows |
|
|
218
218
|
| `refresh` | Re-download every subscription |
|
|
219
219
|
|
|
220
220
|
## HTTP routes
|
package/client.js
CHANGED
|
@@ -36,11 +36,11 @@ const en = {
|
|
|
36
36
|
noNodes: 'No node table yet — start routing first.',
|
|
37
37
|
select: 'Use',
|
|
38
38
|
testing: 'Measuring…',
|
|
39
|
-
testNow: '
|
|
39
|
+
testNow: 'Test current node',
|
|
40
40
|
delay: '{ms} ms',
|
|
41
41
|
unreachable: 'no answer',
|
|
42
42
|
untested: 'not measured',
|
|
43
|
-
testAll: '
|
|
43
|
+
testAll: 'Test all nodes',
|
|
44
44
|
cycle: 'Automatic speed test',
|
|
45
45
|
cycleHint:
|
|
46
46
|
'How often the plugin re-measures its nodes and picks a working exit. 0 turns the cycle off; the button above still works.',
|
|
@@ -76,8 +76,6 @@ const en = {
|
|
|
76
76
|
blockedTag: 'blocked',
|
|
77
77
|
blockedCount: '{count} nodes hidden',
|
|
78
78
|
blockedInvalid: 'Invalid regex, not applied:',
|
|
79
|
-
reselect: 'Re-pick node by capability',
|
|
80
|
-
reselecting: 'Testing nodes…',
|
|
81
79
|
chosenNode: 'Chosen: {node}',
|
|
82
80
|
noUsableNode: 'No node reached every required service.',
|
|
83
81
|
usableCount: '{usable} / {total} nodes usable',
|
|
@@ -133,8 +131,6 @@ const en = {
|
|
|
133
131
|
limitedNote: '{count} limited, {blocked} blocked',
|
|
134
132
|
healthRoundNote: 'Every {every}s · last round {state} at {latency} ms (ceiling {ceiling} ms) · streak {strikes}/{limit}',
|
|
135
133
|
lastSwitchNote: 'Switched {from} → {to} at {time}',
|
|
136
|
-
runHealth: 'Check the live node now',
|
|
137
|
-
healthRunning: 'Checking the live node…',
|
|
138
134
|
healthOff: 'Health watch off',
|
|
139
135
|
readOnly: 'This panel is read-only here; open it from Settings to edit.',
|
|
140
136
|
}
|
|
@@ -171,11 +167,11 @@ const zh = {
|
|
|
171
167
|
noNodes: '还没有节点表——先启动一次。',
|
|
172
168
|
select: '用这个',
|
|
173
169
|
testing: '测速中…',
|
|
174
|
-
testNow: '
|
|
170
|
+
testNow: '当前节点测试',
|
|
175
171
|
delay: '{ms} ms',
|
|
176
172
|
unreachable: '无响应',
|
|
177
173
|
untested: '未测速',
|
|
178
|
-
testAll: '
|
|
174
|
+
testAll: '全部节点测试',
|
|
179
175
|
cycle: '自动测速',
|
|
180
176
|
cycleHint: '插件多久重新测一次节点并挑一个可用的出口。填 0 关闭周期,上面的按钮仍然可用。',
|
|
181
177
|
cycleOff: '关闭',
|
|
@@ -232,8 +228,6 @@ const zh = {
|
|
|
232
228
|
limitedNote: '{count} 个限流,{blocked} 个不通',
|
|
233
229
|
healthRoundNote: '每 {every} 秒 · 最近一轮 {state},{latency} ms(阈值 {ceiling} ms)· 连续 {strikes}/{limit}',
|
|
234
230
|
lastSwitchNote: '已于 {time} 从「{from}」切到「{to}」',
|
|
235
|
-
runHealth: '立刻检测当前节点',
|
|
236
|
-
healthRunning: '正在检测当前节点…',
|
|
237
231
|
healthOff: '可用性监视已关闭',
|
|
238
232
|
blockedEmpty: '还没有节点清单——先启动一次,这里就会出现可勾选的节点。',
|
|
239
233
|
blockedSearch: '筛选节点…',
|
|
@@ -244,8 +238,6 @@ const zh = {
|
|
|
244
238
|
blockedApplied: '已应用',
|
|
245
239
|
blockedStale: '订阅里已没有',
|
|
246
240
|
blockedPick: '勾选屏蔽(图形化)',
|
|
247
|
-
reselect: '按能力重挑节点',
|
|
248
|
-
reselecting: '正在测节点…',
|
|
249
241
|
chosenNode: '已选:{node}',
|
|
250
242
|
noUsableNode: '没有任何节点能访问全部必需服务。',
|
|
251
243
|
usableCount: '{usable} / {total} 个节点可用',
|
|
@@ -875,11 +867,13 @@ function Panel(props) {
|
|
|
875
867
|
}, name === live?.node ? '✓' : t('select')),
|
|
876
868
|
])
|
|
877
869
|
})),
|
|
870
|
+
// Exactly two ways to measure: the node carrying traffic, and the whole subscription.
|
|
871
|
+
// Both answer latency AND usability, because a fast node that cannot reach a required
|
|
872
|
+
// service is not a working node -- the two used to be separate buttons and separate
|
|
873
|
+
// measurements, which is how a list could show "120 ms" beside "blocked".
|
|
878
874
|
h('div', { key: 'ac', className: 'clxp-actions' }, [
|
|
879
|
-
h('button', { key: 'te', type: 'button', disabled: busy !== '' || !running, onClick: () => void props.onAction('test') }, busy === 'test' ? t('testing') : t('testNow')),
|
|
880
|
-
h('button', { key: 'ta', type: 'button', disabled: busy !== '' || !running, onClick: () => void props.onAction('test', { all: true }) }, busy === 'test' ? t('testing') : t('testAll')),
|
|
881
|
-
h('button', { key: 'hl', type: 'button', disabled: busy !== '' || !running, onClick: () => void props.onAction('health') }, busy === 'health' ? t('healthRunning') : t('runHealth')),
|
|
882
|
-
h('button', { key: 'rs', type: 'button', className: 'clxp-primary', disabled: busy !== '' || !running, onClick: () => void props.onAction('reselect') }, busy === 'reselect' ? t('reselecting') : t('reselect')),
|
|
875
|
+
h('button', { key: 'te', type: 'button', disabled: busy !== '' || !running, onClick: () => void props.onAction('test', { current: true }) }, busy === 'test' ? t('testing') : t('testNow')),
|
|
876
|
+
h('button', { key: 'ta', type: 'button', className: 'clxp-primary', disabled: busy !== '' || !running, onClick: () => void props.onAction('test', { all: true }) }, busy === 'test' ? t('testing') : t('testAll')),
|
|
883
877
|
]),
|
|
884
878
|
// What the automatic switch is doing: armed or not, the live node's streak, and the last
|
|
885
879
|
// switch it performed. Without this the panel shows a limited node and no reason it is
|
package/index.js
CHANGED
|
@@ -410,6 +410,12 @@ export class Runtime {
|
|
|
410
410
|
this.healthTimer = undefined
|
|
411
411
|
/** True while a round is running, so two ticks cannot overlap. */
|
|
412
412
|
this.healthRunning = false
|
|
413
|
+
/** True while a survey matrix is running, so a manual test cannot share the PROBE group. */
|
|
414
|
+
this.switching = false
|
|
415
|
+
/** True while a manual test matrix is running. */
|
|
416
|
+
this.testing = false
|
|
417
|
+
/** Last manual test, so the panel can say when it ran and what it covered. */
|
|
418
|
+
this.lastTest = undefined
|
|
413
419
|
/** What the last automatic switch did, for the panel. */
|
|
414
420
|
this.lastSwitch = undefined
|
|
415
421
|
/** Persistence hook, set by `apply` from the config editor; undefined when the profile has none. */
|
|
@@ -502,6 +508,81 @@ export class Runtime {
|
|
|
502
508
|
return Object.fromEntries(measured)
|
|
503
509
|
}
|
|
504
510
|
|
|
511
|
+
/**
|
|
512
|
+
* Measure nodes for latency AND usability in one pass, writing both into the tables that
|
|
513
|
+
* `status()` renders from.
|
|
514
|
+
*
|
|
515
|
+
* The panel offers exactly two buttons and both answer the whole question. Latency alone is
|
|
516
|
+
* not an answer: a node that replies in 120 ms but cannot reach a required service is
|
|
517
|
+
* broken, and measuring the two halves in different code paths is what let the list show a
|
|
518
|
+
* fast number beside a failing verdict with nothing connecting them.
|
|
519
|
+
*
|
|
520
|
+
* The matrix runs one node at a time on purpose: the core decides the exit per connection,
|
|
521
|
+
* so the PROBE listener can only carry one selection at a time.
|
|
522
|
+
*
|
|
523
|
+
* @param options - `current` measures the selected node; `only` measures one named node;
|
|
524
|
+
* no option measures every node.
|
|
525
|
+
* @returns `{ state, rows, tested, skipped, total, summary }`.
|
|
526
|
+
*/
|
|
527
|
+
async testNodes(options = {}) {
|
|
528
|
+
if (this.core === undefined || this.core.running !== true) return { state: 'core-not-running', rows: [] }
|
|
529
|
+
if (this.healthRunning === true || this.switching === true) return { state: 'busy', rows: [] }
|
|
530
|
+
if (this.testing === true) return { state: 'in-flight', rows: [] }
|
|
531
|
+
this.testing = true
|
|
532
|
+
try {
|
|
533
|
+
const plan = this.probePlan()
|
|
534
|
+
if (plan.specs.length === 0) return { state: 'no-probes', rows: [] }
|
|
535
|
+
const group = await this.core.group()
|
|
536
|
+
const live = group.all.filter((name) => name !== 'DIRECT')
|
|
537
|
+
const only = options.only === undefined ? '' : String(options.only).trim()
|
|
538
|
+
let nodes
|
|
539
|
+
if (only !== '') nodes = live.includes(only) ? [only] : []
|
|
540
|
+
else if (options.current === true) nodes = group.now === undefined || group.now === 'DIRECT' ? [] : [group.now]
|
|
541
|
+
else nodes = live
|
|
542
|
+
if (nodes.length === 0) return { state: 'no-node', rows: [] }
|
|
543
|
+
|
|
544
|
+
const budgetMs = Math.max(5_000, Math.min(Number(this.config.selectBudgetMs ?? 90_000), 300_000))
|
|
545
|
+
const matrix = await this.core.realMatrix({
|
|
546
|
+
nodes,
|
|
547
|
+
specs: plan.specs,
|
|
548
|
+
gating: plan.gating,
|
|
549
|
+
delays: this.measured,
|
|
550
|
+
budgetMs,
|
|
551
|
+
timeoutMs: this.config.probeTimeoutMs ?? 8000,
|
|
552
|
+
})
|
|
553
|
+
|
|
554
|
+
const at = Date.now()
|
|
555
|
+
const measured = new Map(this.measured)
|
|
556
|
+
for (const row of matrix.rows) {
|
|
557
|
+
this.healthRows.set(row.name, { results: row.results, verdict: row.verdict, at })
|
|
558
|
+
// Latency reuses the gating probes that just ran: either number is a real round trip
|
|
559
|
+
// through this node, and measuring again would double the cost for the same answer.
|
|
560
|
+
let fastest
|
|
561
|
+
for (const result of Object.values(row.results)) {
|
|
562
|
+
if (result?.ok === true && typeof result.ms === 'number' && (fastest === undefined || result.ms < fastest)) {
|
|
563
|
+
fastest = result.ms
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
if (fastest !== undefined) measured.set(row.name, fastest)
|
|
567
|
+
}
|
|
568
|
+
this.measured = measured
|
|
569
|
+
this.measuredAt = at
|
|
570
|
+
this.lastMatrix = matrix.rows.map((row) => ({ name: row.name, results: row.results }))
|
|
571
|
+
this.lastTest = { at, tested: matrix.tested, skipped: matrix.skipped, total: nodes.length }
|
|
572
|
+
const rows = this.buildRealRows(nodes)
|
|
573
|
+
return {
|
|
574
|
+
state: 'ok',
|
|
575
|
+
rows,
|
|
576
|
+
tested: matrix.tested,
|
|
577
|
+
skipped: matrix.skipped,
|
|
578
|
+
total: nodes.length,
|
|
579
|
+
summary: summariseRows(rows),
|
|
580
|
+
}
|
|
581
|
+
} finally {
|
|
582
|
+
this.testing = false
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
|
|
505
586
|
/** Record a node the user picked, so a restart keeps it without a config edit. */
|
|
506
587
|
rememberNode(name) {
|
|
507
588
|
this.config.node = name
|
|
@@ -1146,8 +1227,8 @@ export class Runtime {
|
|
|
1146
1227
|
}
|
|
1147
1228
|
|
|
1148
1229
|
/**
|
|
1149
|
-
* Re-check the current node on demand, as `clash_proxy action=
|
|
1150
|
-
* button do.
|
|
1230
|
+
* Re-check the current node on demand, as `clash_proxy action=test` and the panel's
|
|
1231
|
+
* current-node button do.
|
|
1151
1232
|
*
|
|
1152
1233
|
* This is the manual entry point now, not a second timer: the scheduled work all lives in
|
|
1153
1234
|
* `healthRound`, so a manual reselect runs one round with `force` and reports the same shape.
|
|
@@ -2303,15 +2384,15 @@ function subscriptionTool(runtime) {
|
|
|
2303
2384
|
'A 403 whose body says "rate limit exceeded" is a spent quota, not a blocked network: the node still works and the answer is another node or a wait, never a repair.',
|
|
2304
2385
|
'action=import takes one or more subscription URLs (one per line, raw https:// or clash://install-config?url=… import links), probes them, restarts the core on them and routes through it. Without append it replaces the list; with append it adds to it.',
|
|
2305
2386
|
'action=start brings routing up on the configured subscriptions; action=stop takes it down and restores direct connections.',
|
|
2306
|
-
'action=select switches the exit node by name (see the node list from status); action=test measures latency for one node or the
|
|
2387
|
+
'action=select switches the exit node by name (see the node list from status); action=test measures both latency and usability for the current node, one named node, or every node, and the result is what the panel list shows; action=refresh re-downloads every subscription.',
|
|
2307
2388
|
].join(' '),
|
|
2308
2389
|
parameters: {
|
|
2309
2390
|
type: 'object',
|
|
2310
2391
|
properties: {
|
|
2311
2392
|
action: {
|
|
2312
2393
|
type: 'string',
|
|
2313
|
-
enum: ['status', 'import', 'start', 'stop', 'restart', 'select', 'test', 'refresh', 'bootstrap'
|
|
2314
|
-
description: 'status reports state; import sets or appends subscriptions; start/stop control routing; restart rebuilds the core (use when it runs but its control API does not answer); select switches the exit node; test measures latency; refresh re-downloads every subscription; bootstrap downloads and installs a private mihomo core when the machine has none
|
|
2394
|
+
enum: ['status', 'import', 'start', 'stop', 'restart', 'select', 'test', 'refresh', 'bootstrap'],
|
|
2395
|
+
description: 'status reports state; import sets or appends subscriptions; start/stop control routing; restart rebuilds the core (use when it runs but its control API does not answer); select switches the exit node; test measures latency and usability for the current node, one node or all of them; refresh re-downloads every subscription; bootstrap downloads and installs a private mihomo core when the machine has none.',
|
|
2315
2396
|
},
|
|
2316
2397
|
url: { type: 'string', description: 'One or more subscription URLs for action=import, one per line. A leading "name " is kept as the display name.' },
|
|
2317
2398
|
append: { type: 'boolean', description: 'For action=import: add to the existing subscriptions instead of replacing them.' },
|
|
@@ -2389,37 +2470,17 @@ function subscriptionTool(runtime) {
|
|
|
2389
2470
|
const report = await runtime.start()
|
|
2390
2471
|
return { ...report, summary: `已启动:${report.endpoint},节点「${report.group.now ?? '未选择'}」,共 ${Math.max(0, report.group.all.length - 1)} 个可选节点。` }
|
|
2391
2472
|
}
|
|
2392
|
-
if (action === 'reselect') {
|
|
2393
|
-
const result = await runtime.autoReselect({ force: true })
|
|
2394
|
-
return {
|
|
2395
|
-
...result,
|
|
2396
|
-
summary: result.state === 'kept'
|
|
2397
|
-
? '当前节点「' + result.node + '」仍能访问全部必需服务(' + (result.required ?? []).join('/') + '),未切换。'
|
|
2398
|
-
: result.state === 'limited'
|
|
2399
|
-
? '当前节点「' + result.node + '」限流(' + (result.limited ?? []).join(',') + '),但常规联网正常;没有找到配额干净的替代节点,保留当前节点。'
|
|
2400
|
-
: result.state === 'switched'
|
|
2401
|
-
? '已从「' + result.from + '」切到「' + result.to + '」(原节点失去 ' + (result.failed ?? []).join(',') + ')。'
|
|
2402
|
-
: result.state === 'selected'
|
|
2403
|
-
? '已选「' + result.chosen + '」。'
|
|
2404
|
-
: result.state === 'switch-deferred'
|
|
2405
|
-
? '当前节点「' + result.node + '」不合格,但有 ' + result.connections + ' 条连接在进行,本轮不切换。'
|
|
2406
|
-
: '没有可用节点:' + (result.required ?? []).join(', ') + ' 无法全部访问。',
|
|
2407
|
-
}
|
|
2408
|
-
}
|
|
2409
|
-
if (action === 'health') {
|
|
2410
|
-
const report = await runtime.healthRound({ force: true })
|
|
2411
|
-
return { ...report, summary: runtime.describeHealth(report) }
|
|
2412
|
-
}
|
|
2413
2473
|
if (action === 'test') {
|
|
2414
2474
|
const target = String(args?.node ?? '').trim()
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2475
|
+
const report = await runtime.testNodes(target === '' ? { current: true } : { only: target })
|
|
2476
|
+
const rows = Array.isArray(report.rows) ? report.rows : []
|
|
2477
|
+
const label = (usable) => (usable === 'ok' ? '可用' : usable === 'limited' ? '限流' : usable === 'blocked' ? '受限' : '未测')
|
|
2478
|
+
return {
|
|
2479
|
+
...report,
|
|
2480
|
+
summary: rows.length === 0
|
|
2481
|
+
? `没有可测的节点(${report.state})。`
|
|
2482
|
+
: rows.map((row) => `「${row.name}」${row.delay === undefined ? '未测到延迟' : `${row.delay} ms`}:${label(row.usable)}`).join('\n'),
|
|
2418
2483
|
}
|
|
2419
|
-
const status = await runtime.status()
|
|
2420
|
-
if (status.node === undefined) throw new Error('no node selected')
|
|
2421
|
-
const delay = await runtime.core.delay(status.node)
|
|
2422
|
-
return { node: status.node, delay, summary: delay === null ? `「${status.node}」测速失败。` : `「${status.node}」延迟 ${delay} ms。` }
|
|
2423
2484
|
}
|
|
2424
2485
|
if (action === 'refresh') {
|
|
2425
2486
|
const provider = await runtime.core.updateProvider()
|
package/lib/routes.js
CHANGED
|
@@ -305,14 +305,6 @@ export function mountRoutes(webServer, runtime, log) {
|
|
|
305
305
|
sendJson(response, answer.ok ? 200 : 400, answer)
|
|
306
306
|
return
|
|
307
307
|
}
|
|
308
|
-
if (action === 'health') {
|
|
309
|
-
// One real-request round on the live node. Long-running by nature (four probes, each a
|
|
310
|
-
// full TLS handshake through a node), so the caller gets the finished report rather than
|
|
311
|
-
// a stream; the panel polls status meanwhile.
|
|
312
|
-
const report = await runtime.healthRound({ force: true })
|
|
313
|
-
sendJson(response, 200, { ok: report.state === 'ok' || report.state === 'switched', ...report })
|
|
314
|
-
return
|
|
315
|
-
}
|
|
316
308
|
if (action === 'probeNode') {
|
|
317
309
|
// Measure one named node for real, without moving live traffic.
|
|
318
310
|
const name = String(body.node ?? '').trim()
|
|
@@ -333,15 +325,17 @@ export function mountRoutes(webServer, runtime, log) {
|
|
|
333
325
|
return
|
|
334
326
|
}
|
|
335
327
|
if (action === 'test') {
|
|
336
|
-
//
|
|
337
|
-
//
|
|
328
|
+
// Two buttons, one route: `current` measures the node carrying traffic, `all` measures
|
|
329
|
+
// every node, and `node` still narrows to one name (the per-row button and the tool).
|
|
330
|
+
// Every mode answers latency AND usability, and both land in status, so the list can
|
|
331
|
+
// show them together instead of the delay from one measurement and a stale verdict.
|
|
338
332
|
const target = String(body.node ?? '').trim()
|
|
339
|
-
const
|
|
340
|
-
force: true,
|
|
333
|
+
const report = await runtime.testNodes({
|
|
341
334
|
only: target === '' ? undefined : target,
|
|
335
|
+
current: body.current === true,
|
|
342
336
|
all: body.all === true,
|
|
343
337
|
})
|
|
344
|
-
sendJson(response, 200, { ok:
|
|
338
|
+
sendJson(response, 200, { ok: report.state === 'ok', ...report })
|
|
345
339
|
return
|
|
346
340
|
}
|
|
347
341
|
if (action === 'select') {
|
package/lib/skill.js
CHANGED
|
@@ -138,7 +138,7 @@ clash_proxy action=select node=<精确节点名>
|
|
|
138
138
|
- 不合格 = **不可用**(某个门槛探针没通)**、被限流**(如 GitHub 配额为 0)**或真实延迟过高**(超过 \`health.maxDelayMs\`,默认 400 ms)。带限流但没别的干净节点时,报告会说「限流」,不说「不可用」。
|
|
139
139
|
- 三次重试是**同一轮内连续**的,所以坏节点几秒内就会被处理,不需要手动介入。
|
|
140
140
|
- 手动换节点会打断正在进行的切换搜索,没必要别动它。
|
|
141
|
-
-
|
|
141
|
+
- 要立刻验证,点面板的「当前节点测试」,或用 \`action=test\`(测当前节点)并看明细。
|
|
142
142
|
|
|
143
143
|
## 五、按症状查
|
|
144
144
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-clash-subscription",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Import one or more Clash/mihomo subscriptions and route the Harness outbound traffic through the private core bundled with this plugin. Runs on Windows, Linux (Ubuntu 22.04/24.04/26.04 LTS) and macOS: the core is fetched and SHA-256 verified on platforms without a bundled copy, from a bare gzip asset unpacked with node:zlib. Every 30 seconds the live node gets up to three immediate real-request attempts; a rate-limited node now counts as a problem, and after three failures every unblocked node is measured and the best one wins: connectivity and a clean quota before the lowest Google latency.",
|
|
3
|
+
"version": "0.13.0",
|
|
4
|
+
"description": "Import one or more Clash/mihomo subscriptions and route the Harness outbound traffic through the private core bundled with this plugin. Runs on Windows, Linux (Ubuntu 22.04/24.04/26.04 LTS) and macOS: the core is fetched and SHA-256 verified on platforms without a bundled copy, from a bare gzip asset unpacked with node:zlib. Every 30 seconds the live node gets up to three immediate real-request attempts; a rate-limited node now counts as a problem, and after three failures every unblocked node is measured and the best one wins: connectivity and a clean quota before the lowest Google latency. The panel offers exactly two test buttons -- current node and all nodes -- and both measure latency and usability in one pass.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
7
7
|
"dsh-plugin",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"locale/*.json",
|
|
35
35
|
"icon.svg",
|
|
36
36
|
"README.md",
|
|
37
|
-
"CHANGELOG-0.
|
|
37
|
+
"CHANGELOG-0.13.0.md",
|
|
38
38
|
"LICENSE"
|
|
39
39
|
],
|
|
40
40
|
"engines": {
|
|
@@ -67,8 +67,9 @@
|
|
|
67
67
|
},
|
|
68
68
|
"homepage": "https://github.com/lc297948801/dsh-clash-subscription#readme",
|
|
69
69
|
"scripts": {
|
|
70
|
-
"test": "node test/regression-0120.mjs && node test/regression-070.mjs",
|
|
70
|
+
"test": "node test/regression-0130.mjs && node test/regression-0120.mjs && node test/regression-070.mjs",
|
|
71
71
|
"test:direct": "node test/regression-0120.mjs",
|
|
72
|
+
"test:buttons": "node test/regression-0130.mjs",
|
|
72
73
|
"test:legacy": "node test/regression-063.mjs",
|
|
73
74
|
"test:linux": "node test/regression-0100.mjs",
|
|
74
75
|
"test:e2e": "node test/e2e-090.mjs"
|
package/CHANGELOG-0.12.0.md
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
# 0.12.0 · 更新节点与订阅链接不再绕节点
|
|
2
|
-
|
|
3
|
-
> 上一版 `0.11.0` · 本版 `0.12.0`
|
|
4
|
-
|
|
5
|
-
## 症状
|
|
6
|
-
|
|
7
|
-
节点列表本来能更新,但一按「检测全部」就报不可达;有时能通,过一会儿同样的链接又报
|
|
8
|
-
`fetch failed`。把代理停掉再检测,反而正常。
|
|
9
|
-
|
|
10
|
-
这类"时好时坏"的报告是最糟糕的一种:它让人以为是订阅站的问题,去换链接、去找客服,而
|
|
11
|
-
真正的原因是**检测本身经过了要检测的东西**。
|
|
12
|
-
|
|
13
|
-
## 根因:订阅检查走的是全局 dispatcher
|
|
14
|
-
|
|
15
|
-
插件在 `routing.apply()` 里把 undici 的全局 dispatcher 指向自己的内核:
|
|
16
|
-
|
|
17
|
-
```js
|
|
18
|
-
// lib/routing.js · 0.11.0
|
|
19
|
-
this.dispose = await this.proxyModule.installProxyFromEnvironment(env, …)
|
|
20
|
-
const undici = await import(pathToFileURL(this.undiciPath).href)
|
|
21
|
-
this.installed = undici.getGlobalDispatcher()
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
那是**给整个进程用的**,插件自己的订阅检测也在里面。而 `lib/subscription.js` 的
|
|
25
|
-
`probeSubscription()` 写的是:
|
|
26
|
-
|
|
27
|
-
```js
|
|
28
|
-
const request = options.fetch ?? fetch // 没有 options.fetch 时就是全局 fetch
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
两条叠起来就是:检查订阅链接的请求,先被送进本地内核,再由某个节点送出去。于是
|
|
32
|
-
|
|
33
|
-
- **节点挂了,链接被判不可达。** 订阅站明明是好的,报告却说是坏的。
|
|
34
|
-
- **检测在花节点的配额。** 「查一下链接」这个动作本身消耗掉它要评估的那个节点的额度。
|
|
35
|
-
- **同一个链接两次答案不同。** 中途换了节点,答案就跟着变,而链接一个字都没改。
|
|
36
|
-
|
|
37
|
-
`startInner()` 里的顺序把这一点钉死了:`routing.apply()` 在第 1746 行,`probeEntries()`
|
|
38
|
-
在第 1757 行——首次启动的探测必然在代理装好之后执行。
|
|
39
|
-
|
|
40
|
-
内核侧(拉取订阅内容)本来就没问题:`proxy-providers` 不写 `proxy:` 时 mihomo 走直连。
|
|
41
|
-
用真机内核三组对照验证过(每变体独立 work 目录以排除缓存):
|
|
42
|
-
|
|
43
|
-
| provider 配置 | `updatedAt` | `nodes` | 结论 |
|
|
44
|
-
|---|---|---|---|
|
|
45
|
-
| `proxy: 'DIRECT'` | 2026-11-26T07:55:55Z | 55 | 直连拉取正常 |
|
|
46
|
-
| `proxy: 'NO-SUCH-NODE'` | `0001-01-01T00:00:00Z` | 0 | 字段真的生效,且名字被严格校验 |
|
|
47
|
-
| 省略 `proxy` 键 | 2026-11-26T07:56:30Z | 55 | 默认直连 |
|
|
48
|
-
| `proxy: 'PROXY'` | 2026-11-26T07:57:42Z | 55 | 也能拉到(走组) |
|
|
49
|
-
|
|
50
|
-
顺带记一笔:`mihomo -t` 只验 YAML/JSON 结构,**不验** `proxy` 指向的节点是否存在——
|
|
51
|
-
两个变体都返回 `test is successful`。证明这个字段生效只能看真机
|
|
52
|
-
`/providers/proxies/<name>` 的 `updatedAt` + `nodes`。
|
|
53
|
-
|
|
54
|
-
## 改法一:插件侧检查改走直连 dispatcher
|
|
55
|
-
|
|
56
|
-
undici 是**按请求**解析 dispatcher 的,所以带 `dispatcher` 的请求会绕开全局那个,而不动
|
|
57
|
-
进程其余部分的策略。新增 `lib/direct.js`:
|
|
58
|
-
|
|
59
|
-
```js
|
|
60
|
-
export class DirectLine {
|
|
61
|
-
constructor({ undiciPath, logger, connectTimeoutMs = 20_000 }) { … }
|
|
62
|
-
|
|
63
|
-
async connect() { // 首次使用时建 agent,之后复用
|
|
64
|
-
if (this.agent !== undefined) return this.fetch
|
|
65
|
-
if (this.pending === undefined) {
|
|
66
|
-
this.pending = (async () => {
|
|
67
|
-
const undici = await import(pathToFileURL(this.undiciPath).href)
|
|
68
|
-
this.undici = undici
|
|
69
|
-
this.agent = new undici.Agent({ connect: { timeout: this.connectTimeoutMs } })
|
|
70
|
-
return this.fetch
|
|
71
|
-
})()
|
|
72
|
-
…
|
|
73
|
-
}
|
|
74
|
-
return await this.pending
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async fetch(url, init = {}) {
|
|
78
|
-
await this.connect()
|
|
79
|
-
return await this.undici.fetch(url, { ...init, dispatcher: this.agent })
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
`index.js` 的 `Runtime` 持有它(`probeFetch()` / `ensureDirectLine()`),两个检测入口都把
|
|
85
|
-
它注入 `probeSubscriptions`:
|
|
86
|
-
|
|
87
|
-
```js
|
|
88
|
-
// probe(raw) 面板「检测全部」
|
|
89
|
-
const direct = await this.probeFetch()
|
|
90
|
-
const report = await probeSubscriptions(parsed.entries, { timeoutMs: 15_000, fetch: direct })
|
|
91
|
-
return { ...report, direct: direct !== undefined, … }
|
|
92
|
-
|
|
93
|
-
// probeEntries(entries) 启动后按 provider 汇总
|
|
94
|
-
const direct = await this.probeFetch()
|
|
95
|
-
const report = await probeSubscriptions(entries, { timeoutMs: 20_000, fetch: direct })
|
|
96
|
-
return { ...report, direct: direct !== undefined }
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
`direct: false` 是**降级标记**,不是报错:这个安装根解析不到 `undici` 时退回全局 fetch,
|
|
100
|
-
面板上会写明「直连不可用,这次检测走了已安装的代理」,而不是把一条好链接报成坏的。
|
|
101
|
-
|
|
102
|
-
agent 按需创建、跨多次检测复用(多订阅时每条重新握手比检测本身还贵),`stop()` 时关闭。
|
|
103
|
-
|
|
104
|
-
## 改法二:内核侧显式写 `proxy: 'DIRECT'`
|
|
105
|
-
|
|
106
|
-
内核默认直连是**没写下来的默认**。插件不该静默依赖一个没写下来的行为——哪天它变了,
|
|
107
|
-
订阅下载就会悄悄开始花节点配额。所以 `lib/core.js` 的 `buildConfig` 现在把意图写进配置:
|
|
108
|
-
|
|
109
|
-
```js
|
|
110
|
-
const proxyTarget = String(providerProxy ?? 'DIRECT').trim()
|
|
111
|
-
…
|
|
112
|
-
providers[name] = {
|
|
113
|
-
type: 'http',
|
|
114
|
-
url: …,
|
|
115
|
-
interval: 3600,
|
|
116
|
-
path: …,
|
|
117
|
-
...(proxyTarget === '' ? {} : { proxy: proxyTarget }),
|
|
118
|
-
…
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
`providerProxy` 留了覆盖口子(写成节点名就走代理,写成空串就交回内核默认),默认值就是用户
|
|
123
|
-
要的行为。
|
|
124
|
-
|
|
125
|
-
## 为什么这条改法能证明
|
|
126
|
-
|
|
127
|
-
`test/regression-0120.mjs` 不读源码文本,全部断言取运行结果。它起一个本机 HTTP 服务当订阅
|
|
128
|
-
站,把全局 dispatcher 指到关闭的端口 `http://127.0.0.1:9` 复现「已装代理」的真实状态,并且
|
|
129
|
-
故意把 `noProxy` 给空串——让连本机地址都被塞进死代理,取最坏情况:
|
|
130
|
-
|
|
131
|
-
| 断言 | 结果 |
|
|
132
|
-
|---|---|
|
|
133
|
-
| 负向对照:全局 fetch 经死代理取订阅 | `connect ECONNREFUSED 127.0.0.1:9`(证明「走代理」真的会挂) |
|
|
134
|
-
| `DirectLine` 用同一个 undici、同一个 URL | `200`,字节数与正文一致 |
|
|
135
|
-
| 同一 `DirectLine` 第二次取 | `200`(agent 复用成立) |
|
|
136
|
-
| `probeSubscriptions` 不注入 fetch | `ok: false`(这就是用户看到的症状) |
|
|
137
|
-
| `probeSubscriptions` 注入直连 fetch | `ok: true`,`nodeCount: 2`,`format: clash` |
|
|
138
|
-
| `runtime.probe()` 在死代理下 | `ok: true` 且 `direct: true` |
|
|
139
|
-
| `runtime.probeEntries()` 在死代理下 | `ok: true` 且 `direct: true` |
|
|
140
|
-
| `runtime.stop()` | 直连线路 `active: false`(不留悬挂连接) |
|
|
141
|
-
| `buildConfig` 产物 | `proxy-providers.sub0.proxy === 'DIRECT'` |
|
|
142
|
-
|
|
143
|
-
四套回归:`regression-0120` 27 passed / `regression-070` 134 / `regression-0100` 48 /
|
|
144
|
-
`regression-063` 29,全绿。
|
|
145
|
-
|
|
146
|
-
## 影响面
|
|
147
|
-
|
|
148
|
-
- 面板「检测全部」「首启探测」「内核拉取订阅」三条路都不再经过节点。
|
|
149
|
-
- 走节点的是**业务流量**——它本来就该走节点,这一点没变。
|
|
150
|
-
- 没有新增配置项:默认行为就是要的行为,不必让用户去开一个开关。
|
|
151
|
-
- `providerProxy` 是内部参数(不暴露在设置页),只在 `buildConfig` 的入参上。
|
|
152
|
-
|
|
153
|
-
## 升级
|
|
154
|
-
|
|
155
|
-
```
|
|
156
|
-
dsh plugin update dsh-clash-subscription
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
装完**完全退出 DSH 再打开**:宿主进程若早于文件改动启动,会继续跑旧代码。
|