mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-21 08:52:43 +08:00
Update _worker.js
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user