Update browser fingerprint headers and observability config
Refined the generateBrowserFingerprint function to use more realistic and concise HTTP headers. Updated wrangler.jsonc to disable general observability but enable and configure detailed logging and tracing with persistence and full sampling.
This commit is contained in:
1 parent
f938c7f457
commit
e1c60d67db
2 files changed
+17
-10
No files matched your search
@@ -68,23 +68,18 @@ export async function selectProxy(env: Env): Promise<ProxyEndpoint | null> {
|
||||
|
||||
/**
|
||||
* Generate realistic browser fingerprint headers
|
||||
* Creates randomized headers to mimic real browser requests and prevent 503 errors
|
||||
* Enhanced with comprehensive headers to bypass DeepL's bot detection
|
||||
* Creates randomized headers to mimic real browser requests
|
||||
* @returns Record<string, string> - Object containing HTTP headers
|
||||
*/
|
||||
export function generateBrowserFingerprint(): Record<string, string> {
|
||||
return {
|
||||
"User-Agent": USER_AGENTS[Math.floor(Math.random() * USER_AGENTS.length)],
|
||||
Accept: "*/*",
|
||||
"Accept-Language":
|
||||
ACCEPT_LANGUAGES[Math.floor(Math.random() * ACCEPT_LANGUAGES.length)],
|
||||
"Accept-Encoding": "gzip, deflate, br, zstd",
|
||||
Origin: "https://www.deepl.com",
|
||||
Referer: "https://www.deepl.com/",
|
||||
"Sec-Fetch-Dest": "empty",
|
||||
"Sec-Fetch-Mode": "cors",
|
||||
"Sec-Fetch-Site": "same-site",
|
||||
Accept: "application/json, text/plain, */*",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
DNT: "1",
|
||||
Connection: "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
};
|
||||
}
|
||||
+13
-1
@@ -22,7 +22,19 @@
|
||||
"main": "src/index.ts",
|
||||
"name": "deeplx",
|
||||
"observability": {
|
||||
"enabled": true
|
||||
"enabled": false,
|
||||
"head_sampling_rate": 1,
|
||||
"logs": {
|
||||
"enabled": true,
|
||||
"head_sampling_rate": 1,
|
||||
"invocation_logs": true,
|
||||
"persist": true
|
||||
},
|
||||
"traces": {
|
||||
"enabled": true,
|
||||
"head_sampling_rate": 1,
|
||||
"persist": true
|
||||
}
|
||||
},
|
||||
"placement": {
|
||||
"mode": "smart"
|
||||
|
||||
Reference in new issue
Block a user