Current time: 06-21-2019, 10:13 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Configuring Dpcker wptagent to work with Charles Proxy (OSX & Win2012 VM)
02-06-2019, 06:37 AM (This post was last modified: 02-16-2019 04:15 AM by dbenson_sapient.)
Post: #1
Configuring Dpcker wptagent to work with Charles Proxy (OSX & Win2012 VM)
Hi there,

I'm running wptagent and wptserver from the Docker containers on OSX.
https://medium.com/@francis.john/local-w...441d7c2513

I need to run all the traffic through Charles Proxy so I can inject the testing script into the pages I'm testing - this is to keep the testing and monitoring project separate from the dev release cycle.

I have agents running on external Windows servers with Charles Proxy, and they intercept traffic and inject code fine for the live sites, but I'm struggling with it in the local setup for internal QA testing pre-release.

I followed the instructions in this article, which seems to work well up to a point:
https://www.bonusbits.com/wiki/HowTo:Set...y_on_macOS

The problem is that I can see requests in Charles, but instead of seeing all the traffic, I just see a single request, which is a 301 (redirected), and I'm a bit stumped as to why.

If anyone has any suggestions as to where I may be going wrong, they will be very gratefully received!
Find all posts by this user
Quote this message in a reply
02-16-2019, 04:02 AM (This post was last modified: 02-16-2019 04:14 AM by dbenson_sapient.)
Post: #2
RE: Configuring Dpcker wptagent to work with Charles Proxy (OSX)
I'm now running Charles Proxy on the Windows 2012 VM instead.

The chrome entry in wptdriver.ini is as follows:

Code:
[chrome]
exe="C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
options='--load-extension="%WPTDIR%\extension" --user-data-dir="%PROFILE%"'
installer=http://www.webpagetest.org/installers/browsers/bak/chrome.dat
command-line='--proxy-pac-url=file:///C:/webpagetest/config.pac'

Note: I have tried both with and without double-quotes around the --proxy-pac-url value, and both double and triple slashes after the URI 'file:' protocol
and config.pac is:

Code:
function FindProxyForURL(url, host) {
  if ((host == "localhost") ||
      (shExpMatch(host, "localhost.*")) ||
      (host == "127.0.0.1")) {
    return "DIRECT";
  }

  return "HTTP 127.0.0.1:8888";
}

Charles is indeed running on port 8888

When I dispatch a test, I can see it arrive in the agent, and the the wptdriver window says:

Code:
Launching: "C:\Program Files (x86)\Google\Chrom SxS\Application\chrome.exe" --load-extension="C:\webpagetest\extension" --user-data-dir="C:\Users\Administrator\AppData\Roaming\webpagetest_profiles\Chrome" --proxy-pac-url-=file:///C:/webpagetest/config.pac

Followed by a bunch of command line options disabling various features (I'll include them at the end incase they are relevant)

Chrome never launches, and in due course the server says "Timed out waiting for the browser to start."

(I've also tried with Firefox, but FF crashes instantly when opened, and for some reason IE doesn't show up as an option in the private instance interface.)


Chrome command line options shown when the work request is received:
Code:
--disable-background-networking --no-default-browser-check --no-first-run --process-per-tab --new-window --silent-debugger-extension-api --disable-infobars --disable-translate --disable--notifications --disable-desktop-notifications --allow-running-insecure-content --disable-save-password-bubble --disable-component-update --disable-background-downloads --disable-add-to-shelf -- disable-client-side-phishing-detection --disable-data-saver-prompt --disable-default-apps --disable-domain-reliability --safebrowsing-disable-auto-update --disable-background-timer-throttle

There may be more but that's as far as I've been able to stretch the virtual display of the VM!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)