Skip to content

Commit

Permalink
use the system proxy option to always use the system proxy settings o…
Browse files Browse the repository at this point in the history
…n insomnia requests
  • Loading branch information
gatzjames committed Sep 20, 2024
1 parent 76c0130 commit 5d6fb77
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/insomnia/src/main/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ async function updateProxy() {
if (httpsProxy) {
proxyRules.push(`https=${parseProxyFromUrl(httpsProxy)}`);
}

session.defaultSession.resolveProxy;
// Set proxy rules in the main session https://www.electronjs.org/docs/latest/api/structures/proxy-config
session.defaultSession.setProxy({
proxyRules: proxyRules.join(';'),
Expand All @@ -32,10 +34,11 @@ async function updateProxy() {
// @TODO Add all our API urls here to bypass the proxy to work as before with axios.
// We can add an option in settings to use the proxy for insomnia API requests and not include them here.
].join(','),
mode: 'system',
});
return;
}
session.defaultSession.setProxy({ proxyRules: '', proxyBypassRules: '' });
session.defaultSession.setProxy({ proxyRules: '', proxyBypassRules: '', mode: 'system' });
}

export async function watchProxySettings() {
Expand Down

0 comments on commit 5d6fb77

Please sign in to comment.