Issue metadata
Sign in to add a comment
|
Request interception won't work with --proxy-server flag
Reported by
excheque...@gmail.com,
Jun 11 2017
|
||||||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3124.4 Safari/537.36 Steps to reproduce the problem: 1. Start Chrome with the --proxy-server flag pointing to a valid and working proxy server. 2. Connect via remote debugging, and write sample code listed here - https://groups.google.com/a/chromium.org/forum/#!topic/headless-dev/uvms04dXTIM 3. Look at results What is the expected behavior? Interception should work What went wrong? Interception doesn't work! More specifically, the Network.requestIntercepted event isn't fired. When Chrome is started without the --proxy-server flag, interception works as intended. Did this work before? N/A Chrome version: 61.0.3124.4 Channel: dev OS Version: OS X 10.12.5 Flash Version:
,
Jun 11 2017
This is related to [#702384].
,
Jun 19 2017
,
Jun 19 2017
,
Jun 22 2017
As per comment#2, the issue looks similar to Bug ID -- 702384, so merging into the same. Please un-merge if not the case. Thank You.
,
Jun 22 2017
702384 is a tracking bug for feature development. This is a bug report, unmerging.
,
Jun 22 2017
,
Jul 7 2017
This is probably because HeadlessURLRequestContextGetter::GetURLRequestContext doesn't set up the proxy_service. Looking at ProfileIOData::Init this is done:
main_request_context_storage_->set_proxy_service(
ProxyServiceFactory::CreateProxyService(
io_thread->net_log(), main_request_context_.get(),
network_delegate.get(),
std::move(profile_params_->proxy_config_service), command_line,
io_thread->WpadQuickCheckEnabled(),
io_thread->PacHttpsUrlStrippingEnabled()));
We should do something similar in HeadlessURLRequestContextGetter.
,
Jul 7 2017
One wrinkle, ProxyServiceFactory::CreateProxyService lives in the chrome/ layer (fortunately the proxy implementation lives in net/) which we (probably) can't use. I expect we'd need to duplicate the file :(
,
Jul 7 2017
Actually can we confirm if this is with --headless or not?
,
Jul 7 2017
Yes it is with --headless.
,
Jul 7 2017
,
Jul 11 2017
#8 is wrong. The proxy service is set up, not sure what I was thinking ;) I wonder if this is something entirely different, exchequer598@ if you're listening is your --proxy_server flag a simple URL or do you have something more complex in there? The --proxy_server flag supported by headless is currently just a URL, but normal chrome supports more complex syntax (which seems to be) parsed by ProxyConfig::ProxyRules::ParseFromString. Maybe headless should use that too?
,
Jul 11 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/094472afa242fa5ec156b2b744b774e1dfd0a046 commit 094472afa242fa5ec156b2b744b774e1dfd0a046 Author: Alex Clarke <alexclarke@chromium.org> Date: Tue Jul 11 14:59:32 2017 Headless: support more complex --proxy_server strings Previously in headless mode --proxy_server only supported a URL where as chrome supports a richer syntax allowing various proxy fallbacks. This patch makes headless mode --proxy_server work the same way. Bug: 732154 Change-Id: I850c6ea5596ffc7e528b3a005a585c209d3af8e5 Reviewed-on: https://chromium-review.googlesource.com/567008 Commit-Queue: Alex Clarke <alexclarke@chromium.org> Reviewed-by: Eric Seckler <eseckler@chromium.org> Cr-Commit-Position: refs/heads/master@{#485630} [modify] https://crrev.com/094472afa242fa5ec156b2b744b774e1dfd0a046/headless/app/headless_shell.cc [modify] https://crrev.com/094472afa242fa5ec156b2b744b774e1dfd0a046/headless/lib/browser/headless_browser_context_impl.cc [modify] https://crrev.com/094472afa242fa5ec156b2b744b774e1dfd0a046/headless/lib/browser/headless_browser_context_options.cc [modify] https://crrev.com/094472afa242fa5ec156b2b744b774e1dfd0a046/headless/lib/browser/headless_browser_context_options.h [modify] https://crrev.com/094472afa242fa5ec156b2b744b774e1dfd0a046/headless/lib/browser/headless_url_request_context_getter.cc [modify] https://crrev.com/094472afa242fa5ec156b2b744b774e1dfd0a046/headless/lib/browser/headless_url_request_context_getter.h [modify] https://crrev.com/094472afa242fa5ec156b2b744b774e1dfd0a046/headless/lib/headless_browser_browsertest.cc [modify] https://crrev.com/094472afa242fa5ec156b2b744b774e1dfd0a046/headless/public/headless_browser.cc [modify] https://crrev.com/094472afa242fa5ec156b2b744b774e1dfd0a046/headless/public/headless_browser.h [modify] https://crrev.com/094472afa242fa5ec156b2b744b774e1dfd0a046/headless/public/headless_browser_context.h
,
Jul 12 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/203e89c4f1912c51bb837e22c7574af1604b05c1 commit 203e89c4f1912c51bb837e22c7574af1604b05c1 Author: Alex Clarke <alexclarke@chromium.org> Date: Wed Jul 12 10:40:00 2017 Headless: Add a test of DevTools request interception with an Auth Proxy There have been some reports of these features not working together. This test tries to ensure that they do work. Bug: 732154 Change-Id: Ieccd55603d35a92342a868fc7753f3af98a4aed7 Reviewed-on: https://chromium-review.googlesource.com/567505 Commit-Queue: Alex Clarke <alexclarke@chromium.org> Reviewed-by: Eric Seckler <eseckler@chromium.org> Cr-Commit-Position: refs/heads/master@{#485917} [modify] https://crrev.com/203e89c4f1912c51bb837e22c7574af1604b05c1/headless/lib/headless_devtools_client_browsertest.cc [modify] https://crrev.com/203e89c4f1912c51bb837e22c7574af1604b05c1/headless/test/headless_browser_test.cc [modify] https://crrev.com/203e89c4f1912c51bb837e22c7574af1604b05c1/headless/test/headless_browser_test.h
,
Jul 12 2017
Well it appears there's nothing fundamental in the net stack that prevents interception working with a proxy. The test I just added spins up a simple Auth proxy and it sets up a HeadelssBrowserContext with the same code path that --proxy_server in HeadlessShell uses, and it tests that devtools interception works. Currently I'm puzzled why this isn't working for the bug reporter.
,
Jul 12 2017
@Alex, Thanks for the test. I've noted it in a slightly related thread (see https://bugs.chromium.org/p/chromium/issues/detail?id=702384#c14), but installing Wireshark fixed the issue for me. I'm guessing there was some dependency I was missing on my box - Ubuntu Xenial's base Docker image.
,
Jul 12 2017
Thanks for closing the loop. I guess we can close this too :)
,
Jul 12 2017
@Alex, Thanks a ton for your work on the interception API. Would you mind helping figure out the dependency that was missing? Install wireshark increases my Docker image's size considerably, so I'd rather install only the Chome interception-specific ones.
,
Jul 13 2017
Issue 681521 has been merged into this issue. |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by zacharyf...@gmail.com
, Jun 11 2017106 KB
106 KB View Download