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
183
votes
27 answers

Using npm behind corporate proxy .pac

I need to download several packages through npm but our corporate proxy configuration is a .pac file (i'm on windows) I have already tried npm config set proxy http://mydomain\username:password@1.2.3.4:8181/proxy.pac npm config set https-proxy…
Doc
  • 5,078
  • 6
  • 52
  • 88
20
votes
1 answer

Is there any way to get git to work directly with a .pac (proxy auto-config) script?

My corporate network works with a PAC script.(http://proxyconf.xxx.yy-ss/proxy.pac). Using the PAC script in the "git config" command does not work. "git config --global http.proxy http://proxyconf.xxx.yy-ss/proxy.pac" I got it to work by…
nitin3685
  • 825
  • 1
  • 9
  • 20
19
votes
3 answers

How to configure Atom to use proxy file (pac) settings?

On Windows, is it possible to configure Atom to use the system default proxy instead of manually specifying the proxy settings in the .apmrc file? I recently started using the atom-editor for Windows (Windows 7 Pro) and so far I like it. I've been…
xDaevax
  • 2,012
  • 2
  • 25
  • 36
18
votes
4 answers

Debugging autoproxy (PAC) javascript with alert()?

I am writing a custom .pac script for use with Firefox. Following numerous examples I've seen, I intersperse alert()s in order to debug it, but no alerts popup, even though the script is clearly being invoked. (I am clicking "Reload" in the…
Chris Noe
  • 36,411
  • 22
  • 71
  • 92
17
votes
3 answers

Linux: how to set up proxy using pac script

I am using Red Hat Enterprise Linux Server release 6.2, and I have only terminal access (no GUI). My company has a proxy auto-config script (PAC), and that is the only way to get internet connection. I had no problem with my windows machine, since…
seemuch
  • 633
  • 3
  • 8
  • 19
13
votes
5 answers

Recommended structure for high traffic website

I'm rewriting a big website, that needs very solid architecture, here are my few questions, and pardon me for mixing apples and oranges and probably kiwi too:) I did a lot of research and ended up totally confused. Main question: Which approach…
CodeVirtuoso
  • 6,318
  • 12
  • 46
  • 62
12
votes
2 answers

Using Proxy Automatic Configuration from IE Settings in .Net

I'm having trouble getting Proxy Automatic Configuration (PAC) in IE options to work as expected using .Net WebRequest. According to this article: Proxy Detection Take the Burden Off Users with Automatic Configuration in .NET The system proxy…
bondar
  • 484
  • 1
  • 3
  • 16
10
votes
4 answers

How to use automatic proxy configuration script in Java

My Internet Explorer is set to have an automatic proxy file(so-called PAC) for web access. Is there a way to use this on my Java program, also ? My below Java code does not seem to use proxy at all. ArrayList ar = new…
Jaeh
  • 609
  • 1
  • 6
  • 19
10
votes
4 answers

How to find proxy server and password from .pac file

I am using dynatrace ajax edition and it requires an proxy server and password to connect to dynatrace server. The problem is I ONLY have the .pac file URL that we use at work. Is it possible to know which proxy server and port my requests resolve…
Ayusman
  • 8,509
  • 21
  • 79
  • 132
8
votes
3 answers

How to use Proxy PAC file for python urllib or request?

How do I include my automatic proxy config file in HTTP libraries like urllib or requests. pacfile = 'http://myintranet.com/proxies/ourproxies.pac' proxy = urllib3.ProxyManager(????????????????)
Kaymatrix
  • 615
  • 2
  • 8
  • 16
8
votes
2 answers

PAC - JavaScript - shExpMatch() vs dnsDomainIs()

What is the difference between shExpMatch() and dnsDomainIs() The definition says: // dnsDomainIs() // Evaluates hostnames and returns true if hostnames match. Used mainly to match and exception individual host names. // Example: if…
Wakan Tanka
  • 7,542
  • 16
  • 69
  • 122
7
votes
4 answers

Why do I get "malformed URL" error when performing remote actions using GitKraken in a corporate environment?

When using GitKraken and attempting to perform remote actions (push/pull/fetch and possibly clone) in my corporate environment I get an error that looks like this: Fetch failed for 'origin' malformed URL [Proxy information] My repository is only…
Caesar Kabalan
  • 753
  • 1
  • 8
  • 18
7
votes
2 answers

How To Authenticate Socks 5 Proxies Inside PAC (Proxy Auto Config) Files

How can you setup PAC files to use SOCKS proxies with authentication? Using this simple PAC file as an example: function FindProxyForURL(url, host) { return "SOCKS 69.123.133.75:7257;"; } How would you connect to that socks proxy using a username…
darkAsPitch
  • 1,855
  • 4
  • 23
  • 35
6
votes
1 answer

HTTPS in PAC file

I am writing a .pac file for use with iOS5 without jailbreak, but I feel trouble in matching the url starting with "https" (eg: https://test.com). Here is my script: function FindProxyForURL(url, host) { if (shExpMatch(url, "https://*")) return…
3went2
  • 83
  • 1
  • 1
  • 6
6
votes
0 answers

php - Use proxy pac file with curl?

Is there a way to use a proxy pac file with curl in php? I'd like my web server to be able to access external web pages through my company's proxy, but rather than a static IP+port, a pac file is used. Can I do this in curl?
user3475234
  • 1,503
  • 3
  • 22
  • 40
1
2 3
9 10