Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 308
frankenstein Avatar asked Jan 18 '26 17:01

frankenstein


1 Answers

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));

like image 77
Sidali Avatar answered Jan 21 '26 05:01

Sidali