Questions tagged [pac]

A proxy auto config file (PAC) is used by a web browser (or other agent) to choose the proxy server to be used using the specified URL as a criteria for the selection.

A proxy auto-config (PAC) file defines how web browsers and other user agents can automatically choose the appropriate proxy server (access method) for fetching a given URL.

A PAC file contains a JavaScript function FindProxyForURL(url, host). This function returns a string with one or more access method specifications that cause the user agent to use a particular proxy server, or to connect directly.

This is an example of a very simple PAC file:

function FindProxyForURL(url, host) {
    return "PROXY proxy.example.com:8080; DIRECT";
}

this PAC file instructs the browser to retrieve all pages through the proxy on port 8080 of the server proxy.example.com. Should this proxy fail to respond, the browser tries to contacts the Web-site directly, without using a proxy.

A more complicated PAC file can be like this:

function FindProxyForURL(url, host) {
    // our local URLs from the domains below example.com don't need a proxy:
    if (shExpMatch(host, "*.example.com")) {
        return "DIRECT";
    }

    // URLs within this network are accessed through
    // port 8080 on fastproxy.example.com:
    if (isInNet(host, "10.0.0.0", "255.255.248.0")) {
        return "PROXY fastproxy.example.com:8080";
    }

    // All other requests go through port 8080 of proxy.example.com.
    // should that fail to respond, go directly to the WWW:
    return "PROXY proxy.example.com:8080; DIRECT";
}
150 questions
5
votes
2 answers

Whats the convention on URL-structure in MVC/HMVC/PAC pattern?

In MVC its like http://www.yourdomain.com/sampleController/sampleAction/ and if you call just /sampleController/ then /sampleController/indexAction/ and if you just call / then /indexController/indexAction/ fires. Of course there are exceptions but…
The Surrican
  • 29,118
  • 24
  • 122
  • 168
5
votes
1 answer

OSX: Why does curl not use Automatic Proxy Configuration / PAC?

My workplace has a fairly complicated PAC file for determining which proxy HTTP(S) traffic should use to get to various internal and external networks. This is fine for Chrome, Safari, etc., but awful for commandline tools (curl, most scripting…
AndrewO
  • 1,590
  • 1
  • 17
  • 24
4
votes
1 answer

How to debug Htmlunit traffic with Fiddler using PAC (proxy auto-config)

I have an application using Htmlunit and need put Fiddler to intercept traffic, i read something about configure it via PAC (proxy auto-config) javascript file that comes with but i cant found the article again. How to configure Htmlunit via PAC ?…
nedprx
  • 41
  • 3
4
votes
0 answers

Maven Pac Proxy Settings.xml

How to configure a Maven proxy .PAC file? How could I proceed in this case? I tried it in all conceivable ways, but I could not find a working solution.
4
votes
1 answer

How to set a proxy auto-configuration script (.pac) to be used in C#?

I'm starting to write some very simple web-apps in C# and occasionally I get exceptions about not having a proxy configured. I am in a work environment that has a rather strict proxy auto-configuration file (.pac -- Proxy Auto-Config). Is there a…
PerryC
  • 1,233
  • 2
  • 12
  • 28
4
votes
4 answers

How to set Proxy Auto Config (PAC) file in sdcard of Android

Excuse me? I pushed the file 'proxy.pac' to sdcard using this command: adb push C:\Users\zuokang.li\Documents\proxy.pac /sdcard/ I try to set proxy auto config in android. So I set pac url "file:///sdcard/proxy.pac".But it cannot work. I don't…
Aaron Lee
  • 751
  • 2
  • 8
  • 18
3
votes
0 answers

Set proxy with PAC script in node webkit

I am attempting to configure proxy settings that include custom rules depending on the host - i.e. use HTTP proxy if the host contains the string "example", otherwise use DIRECT, i.e: Host Rule example.com HTTP:…
nick_j_white
  • 534
  • 6
  • 27
3
votes
0 answers

Can someone help me create a decent PAC file?

I'm trying to create a simple PAC file for blocking internet baddies. I found a nice list I would like to use, but I have no coding knowledge at all. This is what I have so far: function FindProxyForURL(url, host) { var normal = "DIRECT"; var…
Gorstak
  • 31
  • 1
3
votes
2 answers

Is it possible to run APC on PHP 5.3.6/IIS/Windows 2008?

The problem is that no binary I could find worked, the APC section never appears in the info display and the apc monitor states that APC is not running. Is there a way to make APC + PHP + IIS work? Thank you
Stephan Tual
  • 2,617
  • 3
  • 27
  • 49
3
votes
0 answers

What is the suggested way to deal with big table in PAC file?

We use PAC file to automaticly select proxys, and it is very often for us to store a big table (whitelist or blacklist) in the PAC file. I'm wondering, how the PAC file is used, and is it possible to preprocess the big table once and keep the…
luochen1990
  • 3,689
  • 1
  • 22
  • 37
3
votes
1 answer

How to check response of Pac script

I need to get the response of the pacScript in my chrome extension.A pacScript will return DIRECT string in case we don't need to proxy and i want to detect that. var config = { mode: "pac_script", pacScript: { url:…
user2650277
  • 6,289
  • 17
  • 63
  • 132
3
votes
0 answers

PAC/JS File with Basic Authentication (JS Coding help)

I am trying to send username:password to a proxy server. My JS file is as such: function FindProxyForURL(url, host) { if (dnsDomainIs(host, ".mydomain.org")) return "DIRECT"; return "PROXY username:password@serverip:3128"; } I have tested…
AJZ
  • 41
  • 6
3
votes
3 answers

Is `127.0.0.1:65535` the network equivalent of `/dev/null`?

In MDN's proxy example, I have seen that they use 127.0.0.1:65535 as an invalid url (link to the source): const allow = "DIRECT"; const deny = "PROXY 127.0.0.1:65535"; ... function FindProxyForURL(url, host) { if (blockedHosts.indexOf(host) != -1)…
3
votes
1 answer

Gradle: set proxy properties through auto-detect proxy settings?

I am using android studio in a network using proxy. Since I need to set the proxy in order to get gradle to work, i was doing some research. I know that adding to Gradle properties the following code should actually…
E.Schaller
  • 33
  • 2
  • 5
3
votes
0 answers

Cannot start internal HTTP server... IntelliJ stopped working

I have IntelliJ and other development tools stopped working today. IntelliJ says on start: Cannot start internal HTTP server. Git integration, JavaScript debugger and LiveEdit may operate with errors. Please check your firewall settings and…
Dims
  • 47,675
  • 117
  • 331
  • 600
1
2
3
9 10