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

Setting a proxy in a Session with `session.setProxy` does nothing on electron >= 5 #21050

Closed
arantes555 opened this issue Nov 8, 2019 · 1 comment

Comments

@arantes555
Copy link

@arantes555 arantes555 commented Nov 8, 2019

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • 5.0.12, 6.1.4, 7.1.1
  • Operating System:
    • macOS 10.14.6 / Ubuntu 19.04 x64
  • Last Known Working Electron version:
    • 4.2.12

Expected Behavior

When using session.setProxy, subesquent requests done with the net API with the specified session should use the proxy configured.

Actual Behavior

Requests ignore the proxy set with session.setProxy

To Reproduce

$ git clone https://github.com/arantes555/electron-bug-net-proxy.git
$ npm install
$ npm start

In this repo, we test this by launching a simple HTTP server and 2 proxies, and running a simple script against them using multiple versions of electron.

When running this, we can see that in electron@4, the requests correctly go through the proxy. However, starting with electron@5, the requests do not follow the proxy at all. Requests that should go through the simple unauthenticated succeed anyway, but there is no log from the proxy, and those that should go through the authenticated proxy fail when setting the proxy works (because credentials are not provided), but succeed on electron@5 and greater.

@nornagon

This comment has been minimized.

Copy link
Member

@nornagon nornagon commented Nov 8, 2019

Requests to localhost bypass proxies by default. Add <-loopback> to your proxy rules if you want to proxy requests to localhost, as described here: https://chromium.googlesource.com/chromium/src/+/master/net/docs/proxy.md#bypass-rule_subtract-implicit-rules

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.