From 6df16f92f116abc8b3b8e1ddea0a37d49125b74f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=AB=E9=81=97=E5=BF=98=E7=9A=84=E8=AE=B0=E5=BF=86?= <32097237+YIWANG-sketch@users.noreply.github.com> Date: Fri, 26 Jul 2024 23:17:45 +0800 Subject: [PATCH] browser proxy --- provider.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/provider.mjs b/provider.mjs index 41893db..c40f0c0 100644 --- a/provider.mjs +++ b/provider.mjs @@ -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) => {