Skip to content

Commit 13e59db

Browse files
committed
fix: 限制CMCC运营商的TCP并发拨号数为1以优化连接稳定性
1 parent 48d1110 commit 13e59db

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

_worker.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export default {
3232
const 访问路径 = url.pathname.slice(1).toLowerCase();
3333
调试日志打印 = ['1', 'true'].includes(env.DEBUG) || 调试日志打印;
3434
预加载竞速拨号 = ['1', 'true'].includes(env.PRELOAD_RACE_DIAL) || 预加载竞速拨号;
35+
if (TCP并发拨号数 !== 1 && 识别运营商(request) === 'cmcc') TCP并发拨号数 = 1;
3536
if (env.PROXYIP) {
3637
const proxyIPs = await 整理成数组(env.PROXYIP);
3738
反代IP = proxyIPs[Math.floor(Math.random() * proxyIPs.length)];
@@ -1855,7 +1856,7 @@ async function forwardataTCP(host, portNum, rawData, ws, respHeader, remoteConnW
18551856
const 连接超时毫秒 = 1000;
18561857
let 已通过代理发送首包 = false;
18571858
const TCP连接 = 创建请求TCP连接器(request);
1858-
if (TCP并发拨号数 !== 1 && 识别运营商(request) === 'cmcc') TCP并发拨号数 = 1;
1859+
18591860
async function 等待连接建立(remoteSock, timeoutMs = 连接超时毫秒) {
18601861
await Promise.race([
18611862
remoteSock.opened,

0 commit comments

Comments
 (0)