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

pacScript config for session.setProxy() method doesn't work in electron v3.0.0-beta.3 #14441

Closed
dhammikamare opened this issue Sep 4, 2018 · 2 comments · Fixed by #14656
Closed
Assignees
Labels
3-0-x bug 🪲 platform/windows status/confirmed A maintainer reproduced the bug or agreed with the feature

Comments

@dhammikamare
Copy link

  • Electron version: v3.0.0-beta.3
  • Operating system: Windows 10 Enterprise 10.0.15063 (x64)
  • Last known working Electron version: v1.4.16

Expected Behavior
Electron app should either detect Use automatic configuration script mentioned in the Internet Options > Connection > LAN Settings > Automatic Configuration
OR
by passing the pacScript to the .setProxy() method of session object.
https://electronjs.org/docs/api/session#sessetproxyconfig-callback

// in main.js
var electron = require('electron');
var path = require('path');
var BrowserWindow = electron.BrowserWindow;

mainWindow = new BrowserWindow({
    webPreferences: {webSecurity: false},
    width: 1024,
    height: 728,
    kiosk: true,
    backgroundColor: "#000000",
    show: false,
    acceptFirstMouse: true
  }); 

mainWindow.webContents.session.setProxy({pacScript:"http://proxy.xyz.com:9001/production.pac"}, 
    function() {
          mainWindow.loadURL(`file://${path.join(__dirname, "/dist/app.html")}`);
});

Actual behavior
Electron app does not detect proxy settings.

To Reproduce
Setup proxy using a pac script

Additional Information
It does identify the proxy when we pass proxyRules to the ses.setProxy(config, callback)

{proxyRules: "proxy.xyz.com:3128", proxyBypassRules: "localhost"}

OR
when we use Internet Options > Connection > LAN Settings > Proxy Server setting on the windows
screenshot

@welcome
Copy link

welcome bot commented Sep 4, 2018

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@sofianguy sofianguy added this to Needs Review in 3.0.x / 3.1.x Sep 4, 2018
@sofianguy sofianguy moved this from Needs Review to Incomplete (blocked/*) in 3.0.x / 3.1.x Sep 6, 2018
@sofianguy
Copy link
Contributor

Can you give 2.0.8 a try and let us know if the bug still persists on that version?

@sofianguy sofianguy added the blocked/need-info ❌ Cannot proceed without more information label Sep 6, 2018
@deepak1556 deepak1556 added status/confirmed A maintainer reproduced the bug or agreed with the feature and removed blocked/need-info ❌ Cannot proceed without more information labels Sep 11, 2018
@deepak1556 deepak1556 self-assigned this Sep 11, 2018
@deepak1556 deepak1556 moved this from Incomplete (blocked/*) to Active Nonblockers in 3.0.x / 3.1.x Sep 11, 2018
@sofianguy sofianguy removed this from Active in 3.0.x / 3.1.x Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3-0-x bug 🪲 platform/windows status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@deepak1556 @sofianguy @dhammikamare and others