Skip to content

Commit f53dbb6

Browse files
authored
Merge pull request cmliu#883 from afsfge/main
修复Surge客户端0RTT配置不生效问题
2 parents 521d484 + ea9cb36 commit f53dbb6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

_worker.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,11 +749,12 @@ function surge(content, url, config_JSON) {
749749
const 每行内容 = content.includes('\r\n') ? content.split('\r\n') : content.split('\n');
750750

751751
let 输出内容 = "";
752+
let realSurgePath = config_JSON.启用0RTT ? config_JSON.PATH + '?ed=2560' : config_JSON.PATH;
752753
for (let x of 每行内容) {
753754
if (x.includes('= tro' + 'jan,')) {
754755
const host = x.split("sni=")[1].split(",")[0];
755756
const 备改内容 = `sni=${host}, skip-cert-verify=${config_JSON.跳过证书验证}`;
756-
const 正确内容 = `sni=${host}, skip-cert-verify=${config_JSON.跳过证书验证}, ws=true, ws-path=${config_JSON.PATH}, ws-headers=Host:"${host}"`;
757+
const 正确内容 = `sni=${host}, skip-cert-verify=${config_JSON.跳过证书验证}, ws=true, ws-path=${realSurgePath}, ws-headers=Host:"${host}"`;
757758
输出内容 += x.replace(new RegExp(备改内容, 'g'), 正确内容).replace("[", "").replace("]", "") + '\n';
758759
} else {
759760
输出内容 += x + '\n';
@@ -1541,3 +1542,4 @@ async function html1101(host, 访问IP) {
15411542
</body>
15421543
</html>`;
15431544
}
1545+

0 commit comments

Comments
 (0)