Update _worker.js

This commit is contained in:
CMLiussss
2024-08-12 17:23:33 +08:00
committed by GitHub
parent dd51fdb124
commit db04a36752

View File

@@ -1535,8 +1535,7 @@ async function getAddressescsv(tls) {
// 检查CSV头部是否包含必需字段
const header = lines[0].split(',');
const tlsIndex = header.indexOf('TLS');
const speedIndex = header.length - 1; // 最后一个字段
const ipAddressIndex = 0;// IP地址在 CSV 头部的位置
const portIndex = 1;// 端口在 CSV 头部的位置
const dataCenterIndex = tlsIndex + 1; // 数据中心是 TLS 的后一个字段
@@ -1549,7 +1548,7 @@ async function getAddressescsv(tls) {
// 从第二行开始遍历CSV行
for (let i = 1; i < lines.length; i++) {
const columns = lines[i].split(',');
const speedIndex = columns.length - 1; // 最后一个字段
// 检查TLS是否为"TRUE"且速度大于DLS
if (columns[tlsIndex].toUpperCase() === tls && parseFloat(columns[speedIndex]) > DLS) {
const ipAddress = columns[ipAddressIndex];