|
1589 | 1589 | encryption: 'none', |
1590 | 1590 | security: 'tls', |
1591 | 1591 | sni: workerDomain, |
1592 | | - fp: 'randomized', |
| 1592 | + fp: enableECH ? 'chrome' : 'randomized', |
1593 | 1593 | type: 'ws', |
1594 | 1594 | host: workerDomain, |
1595 | 1595 | path: wsPath |
1596 | 1596 | }); |
1597 | 1597 |
|
1598 | | - // 如果启用了ECH且有ECH配置,添加ech参数 |
| 1598 | + // 如果启用了ECH且有ECH配置,添加ech参数(ECH需要伪装成Chrome浏览器) |
1599 | 1599 | if (enableECH && echConfig) { |
| 1600 | + wsParams.set('alpn', 'h3,h2,http/1.1'); |
1600 | 1601 | wsParams.set('ech', echConfig); |
1601 | 1602 | } |
1602 | 1603 |
|
|
1673 | 1674 | path: wsPath |
1674 | 1675 | }); |
1675 | 1676 |
|
1676 | | - // 如果启用了ECH且有ECH配置,添加ech参数 |
| 1677 | + // 如果启用了ECH且有ECH配置,添加ech参数(ECH需要伪装成Chrome浏览器) |
1677 | 1678 | if (enableECH && echConfig) { |
| 1679 | + wsParams.set('alpn', 'h3,h2,http/1.1'); |
1678 | 1680 | wsParams.set('ech', echConfig); |
1679 | 1681 | } |
1680 | 1682 |
|
|
5296 | 5298 | if (CF_HTTPS_PORTS.includes(port)) { |
5297 | 5299 |
|
5298 | 5300 | const wsNodeName = `${nodeName}-${port}-WS-TLS`; |
5299 | | - let link = `${proto}://${user}@${item.ip}:${port}?encryption=none&security=tls&sni=${workerDomain}&fp=randomized&type=ws&host=${workerDomain}&path=${wsPath}`; |
| 5301 | + let link = `${proto}://${user}@${item.ip}:${port}?encryption=none&security=tls&sni=${workerDomain}&fp=${enableECH ? 'chrome' : 'randomized'}&type=ws&host=${workerDomain}&path=${wsPath}`; |
5300 | 5302 |
|
5301 | | - // 如果启用了ECH且有ECH配置,添加ech参数 |
| 5303 | + // 如果启用了ECH且有ECH配置,添加ech参数(ECH需要伪装成Chrome浏览器) |
5302 | 5304 | if (enableECH && echConfig) { |
5303 | | - link += `&ech=${encodeURIComponent(echConfig)}`; |
| 5305 | + link += `&alpn=h3%2Ch2%2Chttp%2F1.1&ech=${encodeURIComponent(echConfig)}`; |
5304 | 5306 | } |
5305 | 5307 |
|
5306 | 5308 | link += `#${encodeURIComponent(wsNodeName)}`; |
|
5315 | 5317 | } else { |
5316 | 5318 |
|
5317 | 5319 | const wsNodeName = `${nodeName}-${port}-WS-TLS`; |
5318 | | - let link = `${proto}://${user}@${item.ip}:${port}?encryption=none&security=tls&sni=${workerDomain}&fp=randomized&type=ws&host=${workerDomain}&path=${wsPath}`; |
| 5320 | + let link = `${proto}://${user}@${item.ip}:${port}?encryption=none&security=tls&sni=${workerDomain}&fp=${enableECH ? 'chrome' : 'randomized'}&type=ws&host=${workerDomain}&path=${wsPath}`; |
5319 | 5321 |
|
5320 | | - // 如果启用了ECH且有ECH配置,添加ech参数 |
| 5322 | + // 如果启用了ECH且有ECH配置,添加ech参数(ECH需要伪装成Chrome浏览器) |
5321 | 5323 | if (enableECH && echConfig) { |
5322 | | - link += `&ech=${encodeURIComponent(echConfig)}`; |
| 5324 | + link += `&alpn=h3%2Ch2%2Chttp%2F1.1&ech=${encodeURIComponent(echConfig)}`; |
5323 | 5325 | } |
5324 | 5326 |
|
5325 | 5327 | link += `#${encodeURIComponent(wsNodeName)}`; |
|
5353 | 5355 | mode: 'stream-one' |
5354 | 5356 | }); |
5355 | 5357 |
|
5356 | | - // 如果启用了ECH且有ECH配置,添加ech参数 |
| 5358 | + // 如果启用了ECH且有ECH配置,添加ech参数(ECH需要伪装成Chrome浏览器) |
5357 | 5359 | if (enableECH && echConfig) { |
| 5360 | + params.set('alpn', 'h3,h2,http/1.1'); |
5358 | 5361 | params.set('ech', echConfig); |
5359 | 5362 | } |
5360 | 5363 |
|
|
5383 | 5386 | const wsNodeName = `${nodeName}-${port}-${atob('VHJvamFu')}-WS-TLS`; |
5384 | 5387 | let link = `${atob('dHJvamFuOi8v')}${password}@${item.ip}:${port}?security=tls&sni=${workerDomain}&fp=chrome&type=ws&host=${workerDomain}&path=${wsPath}`; |
5385 | 5388 |
|
5386 | | - // 如果启用了ECH且有ECH配置,添加ech参数 |
| 5389 | + // 如果启用了ECH且有ECH配置,添加ech参数(ECH需要伪装成Chrome浏览器) |
5387 | 5390 | if (enableECH && echConfig) { |
5388 | | - link += `&ech=${encodeURIComponent(echConfig)}`; |
| 5391 | + link += `&alpn=h3%2Ch2%2Chttp%2F1.1&ech=${encodeURIComponent(echConfig)}`; |
5389 | 5392 | } |
5390 | 5393 |
|
5391 | 5394 | link += `#${encodeURIComponent(wsNodeName)}`; |
|
5402 | 5405 | const wsNodeName = `${nodeName}-${port}-${atob('VHJvamFu')}-WS-TLS`; |
5403 | 5406 | let link = `${atob('dHJvamFuOi8v')}${password}@${item.ip}:${port}?security=tls&sni=${workerDomain}&fp=chrome&type=ws&host=${workerDomain}&path=${wsPath}`; |
5404 | 5407 |
|
5405 | | - // 如果启用了ECH且有ECH配置,添加ech参数 |
| 5408 | + // 如果启用了ECH且有ECH配置,添加ech参数(ECH需要伪装成Chrome浏览器) |
5406 | 5409 | if (enableECH && echConfig) { |
5407 | | - link += `&ech=${encodeURIComponent(echConfig)}`; |
| 5410 | + link += `&alpn=h3%2Ch2%2Chttp%2F1.1&ech=${encodeURIComponent(echConfig)}`; |
5408 | 5411 | } |
5409 | 5412 |
|
5410 | 5413 | link += `#${encodeURIComponent(wsNodeName)}`; |
|
0 commit comments