Skip to content

Commit cd17113

Browse files
authored
干掉了 一些可能不兼容的参数
1 parent 51ea98f commit cd17113

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

明文源吗

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,8 +1204,7 @@ function generateLinksFromSource(list, user, workerDomain) {
12041204
fp: 'chrome',
12051205
type: 'ws',
12061206
host: workerDomain,
1207-
path: wsPath,
1208-
alpn: 'h3,h2,http/1.1'
1207+
path: wsPath
12091208
});
12101209
links.push(`${proto}://${user}@${safeIP}:${port}?${wsParams.toString()}#${encodeURIComponent(wsNodeName)}`);
12111210
} else {
@@ -1274,8 +1273,7 @@ async function generateTrojanLinksFromSource(list, user, workerDomain) {
12741273
fp: 'chrome',
12751274
type: 'ws',
12761275
host: workerDomain,
1277-
path: wsPath,
1278-
alpn: 'h3,h2,http/1.1'
1276+
path: wsPath
12791277
});
12801278
links.push(`${atob('dHJvamFuOi8v')}${password}@${safeIP}:${port}?${wsParams.toString()}#${encodeURIComponent(wsNodeName)}`);
12811279
} else {
@@ -1426,7 +1424,7 @@ async function forwardTCP(addrType, host, portNum, rawData, ws, respHeader, remo
14261424
return;
14271425
} catch (socksErr) {
14281426
let backupHost, backupPort;
1429-
if (fallbackAddress && fallbackPort) {
1427+
if (fallbackAddress && fallbackAddress.trim() && fallbackPort) {
14301428
backupHost = fallbackAddress;
14311429
backupPort = parseInt(fallbackPort, 10) || portNum;
14321430
} else {
@@ -1446,7 +1444,7 @@ async function forwardTCP(addrType, host, portNum, rawData, ws, respHeader, remo
14461444
}
14471445
} else {
14481446
let backupHost, backupPort;
1449-
if (fallbackAddress && fallbackPort) {
1447+
if (fallbackAddress && fallbackAddress.trim() && fallbackPort) {
14501448
backupHost = fallbackAddress;
14511449
backupPort = parseInt(fallbackPort, 10) || portNum;
14521450
} else {
@@ -3354,7 +3352,7 @@ function generateLinksFromNewIPs(list, user, workerDomain) {
33543352
if (CF_HTTPS_PORTS.includes(port)) {
33553353

33563354
const wsNodeName = `${nodeName}-${port}-WS-TLS`;
3357-
const link = `${proto}://${user}@${item.ip}:${port}?encryption=none&security=tls&sni=${workerDomain}&fp=chrome&alpn=h3%2Ch2%2Chttp%2F1.1&type=ws&host=${workerDomain}&path=${wsPath}#${encodeURIComponent(wsNodeName)}`;
3355+
const link = `${proto}://${user}@${item.ip}:${port}?encryption=none&security=tls&sni=${workerDomain}&fp=chrome&type=ws&host=${workerDomain}&path=${wsPath}#${encodeURIComponent(wsNodeName)}`;
33583356
links.push(link);
33593357
} else if (CF_HTTP_PORTS.includes(port)) {
33603358

@@ -3366,7 +3364,7 @@ function generateLinksFromNewIPs(list, user, workerDomain) {
33663364
} else {
33673365

33683366
const wsNodeName = `${nodeName}-${port}-WS-TLS`;
3369-
const link = `${proto}://${user}@${item.ip}:${port}?encryption=none&security=tls&sni=${workerDomain}&fp=chrome&alpn=h3%2Ch2%2Chttp%2F1.1&type=ws&host=${workerDomain}&path=${wsPath}#${encodeURIComponent(wsNodeName)}`;
3367+
const link = `${proto}://${user}@${item.ip}:${port}?encryption=none&security=tls&sni=${workerDomain}&fp=chrome&type=ws&host=${workerDomain}&path=${wsPath}#${encodeURIComponent(wsNodeName)}`;
33703368
links.push(link);
33713369
}
33723370
});
@@ -3392,8 +3390,7 @@ function generateXhttpLinksFromSource(list, user, workerDomain) {
33923390
type: 'xhttp',
33933391
host: workerDomain,
33943392
path: `/${nodePath}`,
3395-
mode: 'stream-one',
3396-
alpn: 'h3,h2,http/1.1'
3393+
mode: 'stream-one'
33973394
});
33983395

33993396
links.push(`vless://${user}@${safeIP}:${port}?${params.toString()}#${encodeURIComponent(wsNodeName)}`);
@@ -3419,7 +3416,7 @@ async function generateTrojanLinksFromNewIPs(list, user, workerDomain) {
34193416
if (CF_HTTPS_PORTS.includes(port)) {
34203417

34213418
const wsNodeName = `${nodeName}-${port}-${atob('VHJvamFu')}-WS-TLS`;
3422-
const link = `${atob('dHJvamFuOi8v')}${password}@${item.ip}:${port}?security=tls&sni=${workerDomain}&fp=chrome&alpn=h3%2Ch2%2Chttp%2F1.1&type=ws&host=${workerDomain}&path=${wsPath}#${encodeURIComponent(wsNodeName)}`;
3419+
const link = `${atob('dHJvamFuOi8v')}${password}@${item.ip}:${port}?security=tls&sni=${workerDomain}&fp=chrome&type=ws&host=${workerDomain}&path=${wsPath}#${encodeURIComponent(wsNodeName)}`;
34233420
links.push(link);
34243421
} else if (CF_HTTP_PORTS.includes(port)) {
34253422

@@ -3431,7 +3428,7 @@ async function generateTrojanLinksFromNewIPs(list, user, workerDomain) {
34313428
} else {
34323429

34333430
const wsNodeName = `${nodeName}-${port}-${atob('VHJvamFu')}-WS-TLS`;
3434-
const link = `${atob('dHJvamFuOi8v')}${password}@${item.ip}:${port}?security=tls&sni=${workerDomain}&fp=chrome&alpn=h3%2Ch2%2Chttp%2F1.1&type=ws&host=${workerDomain}&path=${wsPath}#${encodeURIComponent(wsNodeName)}`;
3431+
const link = `${atob('dHJvamFuOi8v')}${password}@${item.ip}:${port}?security=tls&sni=${workerDomain}&fp=chrome&type=ws&host=${workerDomain}&path=${wsPath}#${encodeURIComponent(wsNodeName)}`;
34353432
links.push(link);
34363433
}
34373434
});

0 commit comments

Comments
 (0)