Skip to content

Commit 6eb6277

Browse files
committed
修复ECH功能:删除额外参数,保持v2.9格式
- 修复图形界面ECH开关显示问题(未开启时正确显示为关闭状态) - 删除ECH相关的额外参数(alpn、insecure、allowInsecure) - 未开启ECH时URL保持v2.9格式,只包含基本参数 - 开启ECH时只添加ech参数,不添加其他额外参数
1 parent b756311 commit 6eb6277

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

明文源吗

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,10 +1589,7 @@
15891589
encryption: 'none',
15901590
security: 'tls',
15911591
sni: workerDomain,
1592-
fp: 'chrome',
1593-
alpn: 'h3,h2,http/1.1',
1594-
insecure: '1',
1595-
allowInsecure: '1',
1592+
fp: 'randomized',
15961593
type: 'ws',
15971594
host: workerDomain,
15981595
path: wsPath
@@ -1671,9 +1668,6 @@
16711668
security: 'tls',
16721669
sni: workerDomain,
16731670
fp: 'chrome',
1674-
alpn: 'h3,h2,http/1.1',
1675-
insecure: '1',
1676-
allowInsecure: '1',
16771671
type: 'ws',
16781672
host: workerDomain,
16791673
path: wsPath
@@ -3577,7 +3571,7 @@
35773571
document.getElementById('ev').checked = config.ev !== 'no';
35783572
document.getElementById('et').checked = config.et === 'yes';
35793573
document.getElementById('ex').checked = config.ex === 'yes';
3580-
document.getElementById('ech').checked = config.ech !== 'no';
3574+
document.getElementById('ech').checked = config.ech === 'yes';
35813575
document.getElementById('tp').value = config.tp || '';
35823576
document.getElementById('scu').value = config.scu || '';
35833577
document.getElementById('epd').checked = config.epd !== 'no';
@@ -5302,7 +5296,7 @@
53025296
if (CF_HTTPS_PORTS.includes(port)) {
53035297

53045298
const wsNodeName = `${nodeName}-${port}-WS-TLS`;
5305-
let link = `${proto}://${user}@${item.ip}:${port}?encryption=none&security=tls&sni=${workerDomain}&fp=chrome&alpn=h3%2Ch2%2Chttp%2F1.1&insecure=1&allowInsecure=1&type=ws&host=${workerDomain}&path=${wsPath}`;
5299+
let link = `${proto}://${user}@${item.ip}:${port}?encryption=none&security=tls&sni=${workerDomain}&fp=randomized&type=ws&host=${workerDomain}&path=${wsPath}`;
53065300

53075301
// 如果启用了ECH且有ECH配置,添加ech参数
53085302
if (enableECH && echConfig) {
@@ -5321,7 +5315,7 @@
53215315
} else {
53225316

53235317
const wsNodeName = `${nodeName}-${port}-WS-TLS`;
5324-
let link = `${proto}://${user}@${item.ip}:${port}?encryption=none&security=tls&sni=${workerDomain}&fp=chrome&alpn=h3%2Ch2%2Chttp%2F1.1&insecure=1&allowInsecure=1&type=ws&host=${workerDomain}&path=${wsPath}`;
5318+
let link = `${proto}://${user}@${item.ip}:${port}?encryption=none&security=tls&sni=${workerDomain}&fp=randomized&type=ws&host=${workerDomain}&path=${wsPath}`;
53255319

53265320
// 如果启用了ECH且有ECH配置,添加ech参数
53275321
if (enableECH && echConfig) {
@@ -5353,9 +5347,6 @@
53535347
security: 'tls',
53545348
sni: workerDomain,
53555349
fp: 'chrome',
5356-
alpn: 'h3,h2,http/1.1',
5357-
insecure: '1',
5358-
allowInsecure: '1',
53595350
type: 'xhttp',
53605351
host: workerDomain,
53615352
path: `/${nodePath}`,
@@ -5390,7 +5381,7 @@
53905381
if (CF_HTTPS_PORTS.includes(port)) {
53915382

53925383
const wsNodeName = `${nodeName}-${port}-${atob('VHJvamFu')}-WS-TLS`;
5393-
let link = `${atob('dHJvamFuOi8v')}${password}@${item.ip}:${port}?security=tls&sni=${workerDomain}&fp=chrome&alpn=h3%2Ch2%2Chttp%2F1.1&insecure=1&allowInsecure=1&type=ws&host=${workerDomain}&path=${wsPath}`;
5384+
let link = `${atob('dHJvamFuOi8v')}${password}@${item.ip}:${port}?security=tls&sni=${workerDomain}&fp=chrome&type=ws&host=${workerDomain}&path=${wsPath}`;
53945385

53955386
// 如果启用了ECH且有ECH配置,添加ech参数
53965387
if (enableECH && echConfig) {
@@ -5409,7 +5400,7 @@
54095400
} else {
54105401

54115402
const wsNodeName = `${nodeName}-${port}-${atob('VHJvamFu')}-WS-TLS`;
5412-
let link = `${atob('dHJvamFuOi8v')}${password}@${item.ip}:${port}?security=tls&sni=${workerDomain}&fp=chrome&alpn=h3%2Ch2%2Chttp%2F1.1&insecure=1&allowInsecure=1&type=ws&host=${workerDomain}&path=${wsPath}`;
5403+
let link = `${atob('dHJvamFuOi8v')}${password}@${item.ip}:${port}?security=tls&sni=${workerDomain}&fp=chrome&type=ws&host=${workerDomain}&path=${wsPath}`;
54135404

54145405
// 如果启用了ECH且有ECH配置,添加ech参数
54155406
if (enableECH && echConfig) {

0 commit comments

Comments
 (0)