Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提高cf兼容性,减少检查到代理关键字 #85

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions _worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,9 @@ async function getSUB(api, request, 追加UA, userAgentHeader) {

async function getUrl(request, targetUrl, 追加UA, userAgentHeader) {
// 设置自定义 User-Agent
const randomVersion = (Math.random() * (8.10 - 7.00) + 7.00).toFixed(2);
const newHeaders = new Headers(request.headers);
newHeaders.set("User-Agent", `v2rayN/6.45 cmliu/CF-Workers-SUB ${追加UA}(${userAgentHeader})`);
newHeaders.set("User-Agent", `v2rayN/${randomVersion} cmliu/CF-Workers-SUB ${追加UA}(${userAgentHeader})`);

// 构建新的请求对象
const modifiedRequest = new Request(targetUrl, {
Expand Down Expand Up @@ -821,4 +822,4 @@ async function KV(request, env, txt = 'ADD.txt', guest) {
headers: { "Content-Type": "text/plain;charset=utf-8" }
});
}
}
}