简体   繁体   English

电子自动更新代理

[英]Electron autoUpdater proxy

I am using:我在用:

  • Electron 1.7.9电子 1.7.9
  • Aurelia奥雷利亚

I have a problem with the electron proxy setting, it doesn't work with autoUpdater .我的电子代理设置有问题,它不适用于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. AutoUpdater 应该使用 Electron Chrome Network API,但在我的情况下这不起作用,AutoUpdater 的方法checkForUpdates绕过代理。 Is there something that I am missing?有什么我想念的吗?

setProxy is now a Promise. setProxy 现在是一个 Promise。 So now you need to put the last function into the .then() function.所以现在您需要将最后一个函数放入 .then() 函数中。 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));<\/code>

"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM