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
2
votes
1 answer

Parse PAC files in Python without using C modules

I am in the sticky situation where I cannot use the pacparser library, and I was hoping someone had a pure python solution (no C/c++ modules). I have a PAC file that has multiple proxies returned: function FindProxyForURL(url,host) { if…
code base 5000
  • 3,812
  • 13
  • 44
  • 73
2
votes
0 answers

how to edit AutoConfigUrl registry for proxy pac using script

We are creating a SSL VPN setup and our SSL VPN Gatway does not push pac files to the end users machines. But it do supoort running scripts when user connects and disconnet the ssl vpn. I have created two batch files placed in system one will get…
user3625334
  • 21
  • 1
  • 1
  • 5
2
votes
0 answers

Use of local pac file

I need to use a local pac file when the user is on a vpn. The problem is that I do not understand how I will get the program to read it. From what I've read .net should be able to pick it up on start from the IE settings. The user can access the web…
user1842278
  • 1,039
  • 1
  • 12
  • 25
2
votes
2 answers

Determining proxy server/port

I apologize if this is a simplistic question, I am not familiar with this kind of thing. I am trying to determine my proxy server ip and port number in order to use a google calendar syncing program. I downloaded the proxy.pac file using google…
DanW
  • 303
  • 3
  • 4
  • 13
2
votes
2 answers

The function FindProxyForURL in pac (proxy-auto-config) file can not work in IE browser

we spent three days still could not solve a strange technical problem, so we need your help. The pac (proxy-auto-config) file we write is working fine in all other browser, except IE(Internet Explorer). the request url is…
EvanChen
  • 21
  • 1
  • 4
2
votes
1 answer

What's the difference between resolving WPAD in process and out of process?

In the WinHTTP autoproxy API, the WINHTTP_AUTOPROXY_OPTIONS will accept flags for WINHTTP_AUTOPROXY_RUN_INPROCESS and WINHTTP_AUTOPROXY_RUN_OUTPROCESS_ONLY. What's the difference between these two flags and when would you use them?
0x1mason
  • 757
  • 8
  • 20
2
votes
1 answer

obtaining proxy from PAC proxy requiring authentication

I am attempting to use WinHttpGetProxyForUrl where the PAC file specified by WINHTTP_AUTOPROXY_OPTIONS.lpszAutoConfigUrl requires HTTP basic authentication to access. Is there some way to cause the regular authentication dialog to popup or to supply…
Bevan Collins
  • 1,531
  • 16
  • 25
1
vote
1 answer

PAC File not filtering sites correctly

Scenario: I work for a public library and we use a paid database to access grant information. Part of our SLA is that users must access the site from one specified IP Address. The user must physically be at one of our locations and the password…
wildfire23
  • 11
  • 1
1
vote
0 answers

How can I block URLs ending with ".pdf" in a PAC file? `shExpMatch()` doesn't work on iOS

Context I’m deploying a Proxy Auto-Config (PAC) file through JAMF MDM using the auto global HTTP proxy. The purpose of this file is to block some traffic on the network level. We’re deploying the PAC files on iPhones. I tried to block all URLs…
checkn8
  • 15
  • 3
1
vote
1 answer

Is "MCID 1 already present" in PDF an accessibility issue?

Working with a PDF assembled from multiple PDFs the PDF Accessibity Checker (PAC) throws an error "PAC Unhandled Exception MCID 1 already present." Is there any way to see and/or fix this issue from within Acrobat or ?? Is the MCID visible within…
raeben
  • 17
  • 2
1
vote
1 answer

pac pcf push does not update component in dynamics

I've been successfully building and updating PCF components for the last two months and all the sudden the command to push the component to dynamics does not seem to update any of the changes I make (not in the current project or in previous…
Dennis
  • 11
  • 2
1
vote
1 answer

How to make Selenium pick my .pac file?

I am using Foxyproxy in Firefox and whenever I want to switch to my sandbox environment I use a .pac file. Life is good. But when I try to automate using a browser based testing utility like Selenium, I am not able to make it go through my Sandbox…
bragboy
  • 34,892
  • 30
  • 114
  • 171
1
vote
0 answers

Connect to SOCKS5 Proxy Via PAC script

In my chrome extension, I am using the PAC script chrome.proxy API that has worked in the past. How do I connect to a SOCKS5 proxy using this method? I have been using this code, but I get a socks error. var config = { mode:…
1
vote
1 answer

How Azure pipelines can get source from Internal TFS and External Git? How can I update the proxy?

I am setting up Azure Pipelines, I have few that get sources from GitHub and trying to setup pipelines to reach TFS on Intranet, I created a Service Connection of type: “Azure Repos/Team Foundation Server” using this Other Git URL:…
ClaudeVernier
  • 427
  • 4
  • 20
1
vote
1 answer

How to avoid 127.0.0.1 on myIpAddress() in .pac files

Any idea how to avoid myIpAddress() always returning 127.0.0.1, instead of actual the host IP address? Environment is Ubuntu 11.04 with Firefox 4.0.1. The standard answer on Wikipedia of removing entries from the /etc/hosts file didn't help.
Markus Pscheidt
  • 6,853
  • 5
  • 55
  • 76