browser proxy

This commit is contained in:
被遗忘的记忆
2024-07-26 23:17:45 +08:00
committed by GitHub
parent dfdbbf4eb7
commit 6df16f92f1
+9
View File
@@ -7,6 +7,7 @@ import { fileURLToPath } from "url";
import { createDirectoryIfNotExists, sleep, extractCookie, getSessionCookie, createDocx } from "./utils.mjs";
import { execSync } from 'child_process';
import os from 'os';
import { createProxyAgent, getProxyArgs, getProxyEnv } from './proxyAgent.mjs';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
@@ -57,6 +58,14 @@ class YouProvider {
customConfig: {
userDataDir: path.join(__dirname, "browser_profiles", username),
executablePath: browserPath,
args: [...getProxyArgs()],
},
customLaunchOptions: {
ignoreDefaultArgs: ['--disable-extensions'],
env: {
...process.env,
...getProxyEnv(),
},
},
})
.then(async (response) => {