diff --git a/明文源码.js b/明文源码.js
index 15d6413..3feba25 100644
--- a/明文源码.js
+++ b/明文源码.js
@@ -2178,6 +2178,17 @@ async function KV(request, env, txt = 'ADD.txt') {
.back-btn:hover {
background: #555;
}
+ .bestip-btn {
+ background: #2196F3;
+ padding: 6px 15px;
+ color: white;
+ border: none;
+ border-radius: 4px;
+ cursor: pointer;
+ }
+ .bestip-btn:hover {
+ background: #1976D2;
+ }
.save-status {
color: #666;
}
@@ -2204,6 +2215,7 @@ async function KV(request, env, txt = 'ADD.txt') {
id="content">${content}
+
@@ -2225,6 +2237,12 @@ async function KV(request, env, txt = 'ADD.txt') {
window.location.href = parentUrl;
}
+ function goBestIP() {
+ const currentUrl = window.location.href;
+ const parentUrl = currentUrl.substring(0, currentUrl.lastIndexOf('/'));
+ window.location.href = parentUrl + '/bestip';
+ }
+
function replaceFullwidthColon() {
const text = textarea.value;
textarea.value = text.replace(/:/g, ':');
@@ -2549,12 +2567,30 @@ async function bestIP(request, env, txt = 'ADD.txt') {
const country = request.cf?.country || 'CN';
const url = new URL(request.url);
- async function GetCFIPs() {
+ async function GetCFIPs(ipSource = 'official') {
try {
- // 首先尝试第一个URL
- let response = await fetch('https://raw.githubusercontent.com/ipverse/asn-ip/master/as/13335/ipv4-aggregated.txt');
- if (!response.ok) {
- // 如果失败,尝试第二个URL
+ let response;
+ if (ipSource === 'as13335') {
+ // AS13335列表
+ response = await fetch('https://raw.githubusercontent.com/ipverse/asn-ip/master/as/13335/ipv4-aggregated.txt');
+ } else if (ipSource === 'as209242') {
+ // AS209242列表
+ response = await fetch('https://raw.githubusercontent.com/ipverse/asn-ip/master/as/209242/ipv4-aggregated.txt');
+ } else if (ipSource === 'cm') {
+ // CM整理列表
+ response = await fetch('https://raw.githubusercontent.com/cmliu/cmliu/main/CF-CIDR.txt');
+ } else if (ipSource === 'baipiao') {
+ // 反代IP列表 (直接IP,非CIDR)
+ response = await fetch('https://raw.githubusercontent.com/cmliu/ACL4SSR/main/baipiao.txt');
+ const text = response.ok ? await response.text() : '';
+ // 直接返回IP列表,不进行CIDR生成
+ const ips = text.split('\n')
+ .map(line => line.trim())
+ .filter(line => line && !line.startsWith('#'));
+ console.log(`反代IP列表获取到${ips.length}个IP`);
+ return ips;
+ } else {
+ // CF官方列表 (默认)
response = await fetch('https://www.cloudflare.com/ips-v4/');
}
@@ -2772,12 +2808,13 @@ async function bestIP(request, env, txt = 'ADD.txt') {
}
}
- const cfIPs = await GetCFIPs();
+ // 移除初始IP加载,改为在前端动态加载
+ const cfIPs = []; // 初始为空数组
// 判断是否为中国用户
const isChina = country === 'CN';
const countryDisplayClass = isChina ? '' : 'proxy-warning';
- const countryDisplayText = isChina ? country : `${country} ⚠️`;
+ const countryDisplayText = isChina ? `${country}` : `${country} ⚠️`;
const html = `
@@ -2808,6 +2845,19 @@ async function bestIP(request, env, txt = 'ADD.txt') {
border-radius: 5px;
margin: 20px 0;
}
+ .test-info {
+ margin-top: 15px;
+ padding: 12px;
+ background-color: #f3e5f5;
+ border: 1px solid #ce93d8;
+ border-radius: 6px;
+ color: #4a148c;
+ }
+ .test-info p {
+ margin: 0;
+ font-size: 14px;
+ line-height: 1.5;
+ }
.proxy-warning {
color: #d32f2f !important;
font-weight: bold !important;
@@ -2919,6 +2969,22 @@ async function bestIP(request, env, txt = 'ADD.txt') {
.append-button:not(:disabled):hover {
background-color: #F57C00;
}
+ .edit-button {
+ background-color: #9C27B0;
+ color: white;
+ padding: 15px 32px;
+ text-align: center;
+ text-decoration: none;
+ display: inline-block;
+ font-size: 16px;
+ cursor: pointer;
+ border: none;
+ border-radius: 4px;
+ transition: background-color 0.3s;
+ }
+ .edit-button:hover {
+ background-color: #7B1FA2;
+ }
.back-button {
background-color: #607D8B;
color: white;
@@ -2986,16 +3052,6 @@ async function bestIP(request, env, txt = 'ADD.txt') {
在线优选IP
-
-
统计信息
-
您的国家:${countryDisplayText}
-
获取到的IP总数:${cfIPs.length} 个
-
测试进度:未开始
-
-
-
${!isChina ? `
🚨 代理检测警告
@@ -3009,12 +3065,34 @@ async function bestIP(request, env, txt = 'ADD.txt') {
建议操作:请关闭所有代理软件(VPN、科学上网工具等),确保处于直连网络环境后重新访问本页面。
` : ''}
+
+
+
统计信息
+
您的国家:${countryDisplayText}
+
获取到的IP总数:点击开始测试后加载
+
测试进度:未开始
+
+
+
📊 测试说明:当前优选方式仅进行网络延迟测试,主要评估连接响应速度,并未包含带宽速度测试。延迟测试可快速筛选出响应最快的IP节点,适合日常使用场景的初步优选。
+
+
-
+
+
+
+
@@ -3036,14 +3115,56 @@ async function bestIP(request, env, txt = 'ADD.txt') {
IP列表
- ${cfIPs.map(ip => `
${ip}
`).join('')}
+
请选择端口和IP库,然后点击"开始延迟测试"加载IP列表