Current time: 01-20-2021, 02:09 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ability to set a Proxy in a script
05-23-2014, 12:29 AM
Post: #3
RE: Ability to set a Proxy in a script
For Chrome you can just specify whatever you want on the command-line (in the chrome tab of the advanced settings). You can either use the direct mappings or you can specify the proxy.

If you specify a proxy, you should use a PAC script that doesn't proxy localhost traffic, otherwise the testing itself will fail (and you'll probably need to host the pac file somewhere).

Here's a PAC script that I've used before:

Code:
function FindProxyForURL(url, host) {
  var lhost = host.toLowerCase();
  host = lhost;

  if ((host == "localhost") ||
      (shExpMatch(host, "localhost.*")) ||
      (host == "127.0.0.1")) {
    return "DIRECT";
  }

  if (url.substring(0,5) == "http:") {
    return "PROXY proxy.example.com:80";
  }

  return "DIRECT";
}
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Ability to set a Proxy in a script - pmeenan - 05-23-2014 12:29 AM

Forum Jump:


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