'Electron autoUpdater proxy

I am using:

  • Electron 1.7.9
  • Aurelia

I have a problem with the electron proxy setting, it doesn't work with autoUpdater. On the main process I have this configuration :

session.defaultSession.setProxy({
    proxyRules : proxyString
 }, function () {
    console.log("proxy ok")
 });

This works in the entire electron app. I can see the logs on squid. AutoUpdater should use Electron Chrome Network API but in my case this not works, the method checkForUpdates of AutoUpdater bypass the proxy. Is there something that I am missing?



Solution 1:[1]

setProxy is now a Promise. So now you need to put the last function into the .then() function. I hope this comment helps other people. this work for me:

window.webContents.session.setProxy({ proxyString }).then(() => {console.log("proxyok")}).catch((err) => console.error(err));

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sidali