Skip to content

Commit 5c60d0d

Browse files
committed
fix: 添加TLS过滤逻辑以优化请求优选API的IP地址处理
1 parent def4ddc commit 5c60d0d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

_worker.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,8 +1064,10 @@ async function 请求优选API(urls, 默认端口 = '443', 超时时间 = 3000)
10641064
const ipIdx = headers.indexOf('IP地址'), portIdx = headers.indexOf('端口');
10651065
const remarkIdx = headers.indexOf('国家') > -1 ? headers.indexOf('国家') :
10661066
headers.indexOf('城市') > -1 ? headers.indexOf('城市') : headers.indexOf('数据中心');
1067+
const tlsIdx = headers.indexOf('TLS');
10671068
dataLines.forEach(line => {
10681069
const cols = line.split(',').map(c => c.trim());
1070+
if (tlsIdx !== -1 && cols[tlsIdx]?.toLowerCase() !== 'true') return;
10691071
const wrappedIP = IPV6_PATTERN.test(cols[ipIdx]) ? `[${cols[ipIdx]}]` : cols[ipIdx];
10701072
results.add(`${wrappedIP}:${cols[portIdx]}#${cols[remarkIdx]}`);
10711073
});

0 commit comments

Comments
 (0)