Skip to content

Commit 693eddf

Browse files
committed
[FEAT] Use standard proxy envs
Use standard proxy environment variables when given, instead of customized ones by the lib.
1 parent fff68ce commit 693eddf

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/backend/main.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,25 @@ app.commandLine?.appendSwitch('ozone-platform-hint', 'auto')
152152
const { showOpenDialog } = dialog
153153

154154
async function initializeWindow(): Promise<BrowserWindow> {
155+
// Initialize global proxy agent
156+
const http_proxy =
157+
process.env.HTTP_PROXY ||
158+
process.env.http_proxy ||
159+
process.env.ALL_PROXY ||
160+
process.env.all_proxy
161+
const https_proxy =
162+
process.env.HTTPS_PROXY ||
163+
process.env.https_proxy ||
164+
process.env.ALL_PROXY ||
165+
process.env.all_proxy
166+
if (http_proxy) {
167+
logInfo('Using HTTP proxy: ' + http_proxy, LogPrefix.Backend)
168+
process.env.GLOBAL_AGENT_HTTP_PROXY = http_proxy
169+
}
170+
if (https_proxy) {
171+
logInfo('Using HTTPS proxy: ' + https_proxy, LogPrefix.Backend)
172+
process.env.GLOBAL_AGENT_HTTPS_PROXY = https_proxy
173+
}
155174
bootstrap()
156175

157176
createNecessaryFolders()

0 commit comments

Comments
 (0)