diff --git a/_worker.js b/_worker.js index 710d286..e93c60e 100644 --- a/_worker.js +++ b/_worker.js @@ -318,7 +318,11 @@ export default { return new Response(订阅内容, { status: 200, headers: responseHeaders }); } return new Response('无效的订阅TOKEN', { status: 403 }); - } else if (访问路径 === 'locations') return fetch(new Request('https://speed.cloudflare.com/locations', { headers: { 'Referer': 'https://speed.cloudflare.com/' } })); + } else if (访问路径 === 'locations') {//反代locations列表 + const cookies = request.headers.get('Cookie') || ''; + const authCookie = cookies.split(';').find(c => c.trim().startsWith('auth='))?.split('=')[1]; + if (authCookie && authCookie == await MD5MD5(UA + 加密秘钥 + 管理员密码)) return fetch(new Request('https://speed.cloudflare.com/locations', { headers: { 'Referer': 'https://speed.cloudflare.com/' } })); + } } else if (管理员密码) {// ws代理 await 反代参数获取(request); return await 处理WS请求(request, userID);