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
1
vote
0 answers

Add manually file pac to Proxy with HtmlUnit

Sorry if my english level isn't good. Can I assign a PAC file to Proxy manually with HtmlUnit? I've tried assign a URL but Java shows exceptions and I think to add manually the file and I see if the file has any error or not. Any help? Thanks.
angelo087
  • 51
  • 5
1
vote
1 answer

Is MVVM pattern a symbiote of MVC + PAC patterns?

I've surfed Wikipedia and have found such an article: http://en.wikipedia.org/wiki/MVC4WPF A part from the link upper: MVC4WPF is an open-source, extensible, automated code pattern developed at Information Control Corporation for Windows…
user2402179
1
vote
1 answer

Using hardcoded pac script in Firefox

I am currently trying to port a chrome extension to firefox (addon-sdk). However I came up with a few problems porting the pac script functionality. When setting a proxy through chromes extension API, you can set a PAC script as string inside the…
patchrail
  • 2,007
  • 1
  • 23
  • 33
1
vote
1 answer

Is PAC, just MVP with passive view?

In few words: is the PAC (Presentation‑Abstraction‑Control) design pattern, just the MVP (Model‑View‑Presenter) pattern where the view is a passive view? As far as I can understand MVP is a Presenter, talking with a Model. Then a View talking to…
Hibou57
  • 6,870
  • 6
  • 52
  • 56
1
vote
0 answers

Updating Internet Explorer/Chrome settings via command line

I've configured my own pac files (containing the proxy server to use and a list of sites/hosts that the proxy bypasses) It would be too much of a hassle to change all browser settings for different computers manually. Ater doing some research I…
Perulo
  • 69
  • 2
  • 7
1
vote
0 answers

Eclipse and Proxy Auto-Config

How do you setup Eclipse to work with an auto-configured proxy with username/password? Even if I try to get the correct proxy address from the script manually, I can't get Eclipse to recognize the credentials. I've tried setting the Proxy setting…
Mike Adler
  • 1,199
  • 9
  • 24
1
vote
2 answers

PAC (proxy auto-config) navigator.appName not available

i've already a working proxy.pac file. I'd like the clients to use different proxyserver depending on their web browser. No problem I thought. There are many java script snippets out there, to detect browser name/version. The samples I found uses…
casper
  • 821
  • 1
  • 8
  • 19
0
votes
1 answer

PAC with kerberos

I am currently working on kerberos, and for now have this doubt on PAC in MS-KILE kerberos extension. Can pac be included in pactype structure within authorization data, is meant for client to decrypt and decode. It seems (if my understanding is…
Varun
  • 85
  • 1
  • 6
0
votes
1 answer

Using a local proxy auto configuration (.pac) file for proxy settings from a chrome extension

I want to modify the proxy settings of chrome using an extension. I want it to use a local .pac file which is present in my extension's root folder. I tried following ways to refer this pac file: settings.pacScript.url = "proxyFile.pac";…
argp21
  • 26
  • 1
  • 3
0
votes
0 answers

Whether the PAC file supports loops?

I have PAC file function FindProxyForURL(url, host) { if (shExpMatch(host, "*site1*")) return 'socks5 xxx.xxx.xxx.xxx:xxxx'; else if (shExpMatch(host, "*site2*")) return 'socks5 xxx.xxx.xxx.xxx:xxxx'; else return "DIRECT" } how this do in…
Besha
  • 35
  • 10
0
votes
0 answers

how do you manage argocd users from terraform code or platform as code?

How to set terraform code to be able to update argocd-cm and argocd-rbac-cm for new user without go to argocd ui.(turning argocd user management as plateform as code). Tried to pull the current argocd-cm and argocd-rbac-cm files, updated them but…
0
votes
0 answers

Routing xhr/fetch requests on the background via PAC file

Assuming I visit website https://example.com (as well as https://tets.example.com) I have a rule that will route all requests via proxy: if (host == 'example.com' || dnsDomainIs(host, '.example.com') But I need to route all background requests too,…
Kirikan
  • 119
  • 6
0
votes
0 answers

How to use proxy auto-configuration script (.pac) in C#?

I cannot get the system's correct proxy settings on Windows 10. The system-wide proxy configuration is setup to use a pac file: There is a simple NodeJS server running on port 3000. It serves the pac file with the correct content type set to…
Tayfe
  • 37
  • 5
0
votes
0 answers

setting chrome pac file url without cache

I want to set a pac file by URL and I want the cache to be very short lived. My code is: chrome.proxy.settings.set({ scope: 'regular', value: { mode: 'pac_script', pacScript: { url: "http://example.com", } } }) In chrome proxy documentation I…
0
votes
0 answers

pac file return a proxy without port number

Yesterday, I received a pac file which defines only proxy but not port number, like this one: function FindProxyForURL(url, host) { if (shExpMatch(host, "vpn.domain.com")) return "PROXY proxy.mydomain.com"; } Then I used ipconfig…
Risto Libera
  • 71
  • 1
  • 8