<h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Electron Version</h3>
<p dir="auto">12.0.2</p>
<h3 dir="auto">What operating system are you using?</h3>
<p dir="auto">macOS</p>
<h3 dir="auto">Operating System Version</h3>
<p dir="auto">MacOS Big Sur 11.2.3</p>
<h3 dir="auto">What arch are you using?</h3>
<p dir="auto">x64</p>
<h3 dir="auto">Last Known Working Electron version</h3>
<p dir="auto">12.0.2</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Set proxy IP</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">I set proxy to report error: err_ NO_ SUPPORTED_ PROXIES。 How to solve this problem?</p>
<p dir="auto"><code class="notranslate">app.commandLine.appendSwitch('proxy-server', 'socks5://username:password@ip:port')</code><br>
<code class="notranslate">win.webContents.session.setProxy({proxyRules: 'socks5://username:password@ip:port'})</code></p>
<p dir="auto">Thanks!!!</p>
<h3 dir="auto">Testcase Gist URL</h3>
<p dir="auto"><em>No response</em></p>
<ul dir="auto">
<li>Electron version: 1.8.4, recent master (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/electron/electron/commit/0d7becff87743924f4fe639b802c405af47672aa/hovercard" href="https://github.com/electron/electron/commit/0d7becff87743924f4fe639b802c405af47672aa"><tt>0d7becf</tt></a>)</li>
<li>Operating system: win7 sp1 x64</li>
</ul>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">it should navigate using the set proxy</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">net::ERR_NO_SUPPORTED_PROXIES is logged in the devtools console</p>
<h3 dir="auto">How to reproduce</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="'use strict';

const {app, BrowserWindow} = require('electron'),
      path = require('path');

let brWin;

app.commandLine.appendSwitch('proxy-server', 'http://user:password@proxy_host:proxy_port');

app.on('ready', () =&gt; {
  brWin = new BrowserWindow({
    width: 1366,
    height: 768,
    closable: true,
    show: true,
    frame: true,
    useContentSize: true,
    webPreferences: {
      devtools: true,
      nodeIntegration: false,
      webviewTag: false,
      sandbox: false,
      allowRunningInsecureContent: true,
      offscreen: false,
      webSecurity: true,
      contextIsolation: true,
      //preload: path.join(__dirname, 'preload.js'),
    },
  });
  brWin.loadURL('about:blank');
  brWin.webContents.openDevTools({mode: 'right'});
});

app.on('window-all-closed', () =&gt; app.exit());"><pre class="notranslate"><span class="pl-s">'use strict'</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-kos">{</span>app<span class="pl-kos">,</span> BrowserWindow<span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'electron'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
      <span class="pl-s1">path</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'path'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">let</span> <span class="pl-s1">brWin</span><span class="pl-kos">;</span>

<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-c1">commandLine</span><span class="pl-kos">.</span><span class="pl-en">appendSwitch</span><span class="pl-kos">(</span><span class="pl-s">'proxy-server'</span><span class="pl-kos">,</span> <span class="pl-s">'http://user:password@proxy_host:proxy_port'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'ready'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-s1">brWin</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">BrowserWindow</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c1">width</span>: <span class="pl-c1">1366</span><span class="pl-kos">,</span>
    <span class="pl-c1">height</span>: <span class="pl-c1">768</span><span class="pl-kos">,</span>
    <span class="pl-c1">closable</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
    <span class="pl-c1">show</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
    <span class="pl-c1">frame</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
    <span class="pl-c1">useContentSize</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
    <span class="pl-c1">webPreferences</span>: <span class="pl-kos">{</span>
      <span class="pl-c1">devtools</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
      <span class="pl-c1">nodeIntegration</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
      <span class="pl-c1">webviewTag</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
      <span class="pl-c1">sandbox</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
      <span class="pl-c1">allowRunningInsecureContent</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
      <span class="pl-c1">offscreen</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
      <span class="pl-c1">webSecurity</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
      <span class="pl-c1">contextIsolation</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
      <span class="pl-c">//preload: path.join(__dirname, 'preload.js'),</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-s1">brWin</span><span class="pl-kos">.</span><span class="pl-en">loadURL</span><span class="pl-kos">(</span><span class="pl-s">'about:blank'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-s1">brWin</span><span class="pl-kos">.</span><span class="pl-c1">webContents</span><span class="pl-kos">.</span><span class="pl-en">openDevTools</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">mode</span>: <span class="pl-s">'right'</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'window-all-closed'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">exit</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<ul dir="auto">
<li>load the above app</li>
<li>in the devtools <code class="notranslate">location = 'http://example.org'</code></li>
</ul>