New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 750556 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

setting HTTP proxy for headless mode is not working in Selenium

Reported by tarun.gu...@gmail.com, Jul 31 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36

Steps to reproduce the problem:
1.in selenium sample script use Chrome options to initialize the webdriver
2. in Chrome_options add the following 
options.add_argument('--headless')
options.add_argument('--proxy-server=host:port')
driver = webdriver.Chrome(executable_path='/Users/tgudela/Downloads/chromedriver', chrome_options=options)
3. then it is not taking the proxy settings, it is working in head mode
i tried all the options using pac, nothing seems to be work

What is the expected behavior?
it has to load the web page and look for the DOM elements using the proxy seeting

What went wrong?
it is not even loading the webpage

Did this work before? No 

Does this work in other browsers? Yes

Chrome version: 60.0.3112.78  Channel: stable
OS Version: OS X 10.12.5
Flash Version: 26.0.0.137

this is stoping me to move to chrome from phantom js even chrome released the headless browser, all the chrome_options, desired capabilities nothing is workig
 

In the chromedriver.log I have this message:
[0731/151015.204074:ERROR:headless_shell.cc(625)] Malformed proxy server url

Components: Internals>Network>HTTP
Labels: TE-NeedsTriageHelp
Adding "TE-NeedsTriageHelp" as the issue related to selenium webdriver.

Components: -Internals>Network>HTTP Internals>Headless
even it is not working with Chrome canary 62 version 

Comment 5 by tak...@gmail.com, Aug 2 2017

For me, the following works (or rather, starts the application but I still get issues with my selenium tests that seems to occur only in headless mode) with --headless:

--proxy-server=localhost:52773

But the following gives an error (Malformed proxy server url):

--proxy-server="http=localhost:52773;https=localhost:52773"

Owner: rvera@chromium.org

Comment 7 by rvera@chromium.org, Aug 7 2017

Labels: -TE-NeedsTriageHelp
This should be working, as of a change submitted on 12 July. The "malformed proxy server url" message was removed from the code with that patch, so if you are seeing that message, you aren't running the newest proxy-parsing code.

This was clearly not the case for 60, but should be there as of 61, for which the branch point was later in July.

If this isn't working for Canary 62, what exactly is it doing or not doing? As above, if the "malformed proxy server url" message comes up at all, it can't be 62. If it's failing without that message, then something else is going on, and we need more information in order to debug it.
Status: Assigned (was: Unconfirmed)

Comment 9 by rvera@chromium.org, Aug 8 2017

Labels: Needs-Feedback
Updating to canary 62, the proxy-server option works again for me. I had the same reported problem before (also using selenium).

What does not work for me is --headless with 
--proxy-bypass-list="*.bla.com"
This list is not used for proxy bypass..

Comment 11 by rvera@chromium.org, Aug 16 2017

Labels: -Needs-Feedback
Yes, proxy bypass hasn't been implemented. I'll take a look at what it will take.

Comment 12 by rvera@google.com, Aug 17 2017

Patch 618207 to add support for proxy bypass is now out for review. It will update this bug once it lands.
Project Member

Comment 13 by bugdroid1@chromium.org, Aug 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1bf0e95c7566a1064a89d9c4874a1659060b0a8f

commit 1bf0e95c7566a1064a89d9c4874a1659060b0a8f
Author: Raul Vera <rvera@chromium.org>
Date: Thu Aug 17 04:35:35 2017

Adds support for --proxy-bypass-list to headless.

Bug:  750556 
Change-Id: I7e9f073a5af223e5c1ea726366583321ab963aa6
Reviewed-on: https://chromium-review.googlesource.com/618207
Reviewed-by: David Vallet <dvallet@chromium.org>
Commit-Queue: David Vallet <dvallet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495073}
[modify] https://crrev.com/1bf0e95c7566a1064a89d9c4874a1659060b0a8f/headless/app/headless_shell.cc
[modify] https://crrev.com/1bf0e95c7566a1064a89d9c4874a1659060b0a8f/headless/app/headless_shell_switches.cc
[modify] https://crrev.com/1bf0e95c7566a1064a89d9c4874a1659060b0a8f/headless/app/headless_shell_switches.h

Comment 14 by rvera@google.com, Aug 20 2017

Status: Fixed (was: Assigned)

Sign in to add a comment