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
0
votes
0 answers

PDFBox 2.0.24 & PAC 2021: 'Annotation is not nested inside an "Annot" structure element'

I am having trouble trying to nest a PDAnnotationText object within a dual PDF/A UA-1 / PDF/A-1a file, giving the above message demonstrated within both PDF Accessibility Checker (versions 3 and 2021) and VeraPDF: - PAC 2021 PAC 2021: Annotation is…
0
votes
0 answers

Assistance with PAC file Configuration for Bypassing Teams and Client IP

I am trying to use a PAC file to route home/VPN users through their home ISP, when using Teams. I have a basic understanding of PAC files, but struggling to implement a more complex requirement like this. Essentially, I need to evaluate two…
DaveOD
  • 1
0
votes
1 answer

Searching for a pre-proxy that supports PAC scripts and basic authentication written in JAVA

I'm searching for a proxy server that I can start/stop within Java Code and (in best case) is written in Java. The proxy server must have support for PAC (Proxy-Auto-Config) scripts and should be able to inject username/password to request header…
FrankS77
  • 271
  • 4
  • 17
0
votes
1 answer

PAC script for proxying traffic, iOS

I am try create proxying web site through WKWebKit, I am find answer that it is possible only use PAC script (https://developer.apple.com/forums/thread/660636). Tell me please, if I am create this PAC Script, it will be work if user will be use…
Ice
  • 680
  • 1
  • 10
  • 23
0
votes
3 answers

Powershell - JSON format to PAC file convert

I have used the following code to display JSON results but now need to change the script to display the output instead of side by side. I have tried a script like below, but just cant seem to get it to do what I want. My question is : I want to…
Arbelac
  • 1,698
  • 6
  • 37
  • 90
0
votes
2 answers

NPM NODE packages for fetching proxy settings from Mac and Linux

Do we have any NPM NODE packages for fetching proxy settings(Could be manual and Pac) from Mac and Linux? For windows we have https://www.npmjs.com/package/get-proxy-settings.
unknown
  • 643
  • 4
  • 15
  • 38
0
votes
0 answers

PAC file issue str.match is not a function

This is PAC file I'm trying to force users to bypass proxies if the destination is local. If the destination is a public IP it will force users' traffic to be distributed on 2 proxies and if they are down the users' traffic will bypass proxies. I'm…
logan_92
  • 117
  • 9
0
votes
1 answer

Automatic Proxy pac and what is the difference

what is the difference between return proxyAll; AND return proxySingle; function FindProxyForURL (url, host) { var proxySingle = "PROXY 1.2.2.1:80"; var proxyAll = "PROXY 1.2.2.1:80;PROXY 1.2.2.2:80;PROXY…
Pit
  • 395
  • 2
  • 11
0
votes
0 answers

Setting up a proxy for a specific url in chrome extension

I'm working on a chrome extension where a button click would trigger a function that calls a specific url and gets back the response. This specific url needs to be accessed through a proxy. All other requests are handled normally. It seemed like…
Lukich
  • 686
  • 1
  • 10
  • 20
0
votes
1 answer

VPN Service setHttpProxy with Pac URI

According to Android docs, the VpnService.Builder.setHttpProxy method has been added in API level 29. Which is fine. But the setHttpProxy method needs and object for ProxyInfo class, which is deprecated in API level 22. Now I need to use the…
Mayur More
  • 951
  • 2
  • 15
  • 37
0
votes
1 answer

Pac file does not work globally on Windows10

I have a socks5 server in 192.168.1.100, and my pac file looks like this: var proxy = "SOCKS5 192.168.1.100:1080; SOCKS 192.168.1.100:1080; DIRECT;"; function FindProxyForURL(url, host) { return proxy; } I set this pac file on Windows10 system…
Vin Qin
  • 129
  • 1
  • 1
  • 8
0
votes
0 answers

how to bypass squid proxy with pac file?

I currently have Squid v3.5.20 installed on a Centos7 VM. The proxy is working well and blocking everything on the block ACL. My issue comes with the PAC file. I want to bypass the proxy for certain sites with the PAC file by return "DIRECT";. All…
Ron
  • 1
  • 1
  • 1
0
votes
1 answer

PAC FILE - Not being loaded

I am new to pac files. I am not sure I made it working. I installed an nginx on a virtual machine. and exposed a pac file to url. (I can easily download pac file by puting url in browser as proof it is working). I then set my computer proxy settings…
0
votes
1 answer

Error using FiddlerCore with proxy auto config file (PAC)

I'm using the stock SampleApp included with FiddlerCore. Http traffic works fine. For Https traffic, I'm getting the following message from FiddlerCore: [Fiddler] Failed to read HTTPS request from (iexplore:6200) new client socket, port…
Jeff
  • 5
  • 3
0
votes
1 answer

Outlook through .PAC file

I'm trying to get my head around a PAC file and apply it to Outlook. All traffice is sent through proxy "A" but Outlook can not get through that and has to go through proxy "B" I have no control over any rule set (government org) so can not make…
user001
  • 415
  • 1
  • 7
  • 22