Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSIS auto-update doesn't use system HTTP proxy #959

Closed
dbkr opened this issue Dec 1, 2016 · 8 comments · May be fixed by qcif/data-curator#563
Closed

NSIS auto-update doesn't use system HTTP proxy #959

dbkr opened this issue Dec 1, 2016 · 8 comments · May be fixed by qcif/data-curator#563

Comments

@dbkr
Copy link

dbkr commented Dec 1, 2016

  • Version: 10.4.1
  • Target: Windows (NSIS)

The NSIS auto-updater appears not to use a system HTTP proxy if Windows is set up with one and instead tries to connect to the update URL directly. On machines where the only web access is via the proxy, this means the app will just not update (even though the embedded chromium appears to use the proxy).

@develar
Copy link
Member

develar commented Dec 1, 2016

Yes. We must not use node http API, but instead use chromium electron API.

@maczikasz
Copy link
Contributor

So I spend some time looking into this feature and assuming you haven't started any work on this, I would propose and do the following:

  • Consolidate all HTTP related requests behind a common interface (stuff from publish/restApiRequest and util/httpRequest
  • and create a HTTP based implementation for this (for publishing and stuff done by the builder)
  • and create an Electron NET api based implementation for the stuff done in AutoUpdater

So then this IF will have to be used by all Providers and Publishers

@develar
Copy link
Member

develar commented Dec 17, 2016

Yes. Electron Chrome Network API mimics node, so should be easy to migrate existing helpers publish/restApiRequest and util/httpRequest.

@maczikasz
Copy link
Contributor

Yes, my point was, that it should be done in a manner where it's possible to use normal HTTP, as net api requires app ready event, also when the app is building or the tests are running there is no electron app, I will create the PR either during the weekend or latest on monday

@maurovitale
Copy link

Hi to all,
my electron proxy setting 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 miss ?

@akioyamamoto1977
Copy link

I have same issue with maurovitale.
Is there any conclusion if there is a way to indicate a proxy server by program code ?

@akioyamamoto1977
Copy link

I have same issue with maurovitale.
Is there any conclusion if there is a way to indicate a proxy server by program code ?

Excuse me putting a comment on this closed issue but I found a solution to indicate a default proxy (for Electron) from program code as below.

app.commandLine.appendSwitch('proxy-server', '127.0.0.1:2222');

@MareikeTaeubner
Copy link

The updater seems to have its own netSession, so changes on session.defaultSession will not work.

This is entirely undocumented, so the API might not be stable or internal, but for now (electron-updater@4.3.9) the following works:

autoUpdater.netSession.setProxy({
      proxyRules: "http://localhost:3128",
});

If your proxy requires authentication you'll need something like this additionally:

autoUpdater.signals.login((_authInfo, callback) => {
  callback("username", "password");
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants