mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-21 17:12:33 +08:00
fix: 更新locations反代逻辑,增加身份验证支持
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user