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

Get http proxy from HtmlUnit WebDriver from .pac proxy file

I have configured an HtmlUnitWebdriver to use a .pac to configure the autoproxy. Is there once I am navigating with the webdriver to return the specific http proxy that it is using? Code for webdriver below. public WebDriver htmlDriver(){ …
Kurter21
  • 63
  • 2
  • 8
0
votes
1 answer

Win 10 and proxy pac

I've just installed the win 10 developer preview and I've tried to set up the proxy configuration with a pac file on an http:blabla url. I can surf the net but not totally, for example I can use Skype and access Gmail but I cannot see Gmail icons…
Andrea Dorigo
  • 165
  • 5
  • 16
0
votes
1 answer

Can I serve a wpad.dat file that tells the requesting system that there are no proxy settings?

I run a company webserver that seems to get hit constantly with wpad.dat requests. It fills up my error logs with 404 not found errors. I had considered ignoring the wpad.dat requests in the config, but upon further inspection it seems that some…
Michael Fever
  • 845
  • 2
  • 8
  • 26
0
votes
1 answer

Persist automatic configuration for proxy on windows

I use a proxy automatic configuration for LAN settings, this is automatic and scripted in a pac file, same as stated in this question, the thing is that everytime I restart the computer, this configuration is lost. Is there a way to persist this…
DanielV
  • 2,076
  • 2
  • 40
  • 61
0
votes
1 answer

Proxy Auto Config Web Test Plugin - VS 2012 Ultimate

I am hoping someone can help me with my problem. I've created a number of web tests which require a web test plugin in order to run. The issue I am having, is that our company proxy is via Proxy Auto Config file. I cannot find anything about passing…
Pir.Rab
  • 56
  • 6
0
votes
1 answer

Using Proxy System Wide Ubuntu

I am using a headless ubuntu system which has no GUI. I want to use a pac-based proxy for my ubuntu. I also want to use it on deluge bittorent client i am using this setting currently gsettings set org.gnome.system.proxy mode 'manual' gsettings set…
Abdul Rehman Janjua
  • 1,461
  • 14
  • 19
0
votes
1 answer

How to parse a PAC file on iOS

So i'm trying to get the proxy info on an iOS device. The OS handily provides use with a function CFNetworkCopySystemProxySettings() to get a dictionary of the settings. When the host and port are provided I have no issue, I can access them in the…
George Green
  • 4,807
  • 5
  • 31
  • 45
0
votes
1 answer

Bypass the proxy i configured in wifi with spdy enabled on my iphone

I configured a proxy with pac file url and enabled spdy-Reduce data usage features on my iphone. After enable this feature all requests from my device will ignore the proxy i configured. Could anyone tell me why? Is there any workaround that my…
harlan
  • 81
  • 1
  • 4
0
votes
2 answers

Read Gmail mails with IMAP protocol behind proxy,firewall with PAC

I have PAC file and proxy port with me but not able to login and readGMail mails. Can anyone show me how to use PAC and proxy port in JAVAMAIL API .I have done setting like propsIMAP = new Properties(); propsSMTP = new Properties(); …
javadev
  • 69
  • 1
  • 1
  • 7
0
votes
1 answer

Error Proxy AutoConfig in HTMLUNIT

I have an application using Htmlunit and I needs to use a PAC file, but HtmlUnit shows an error and I don't know why. The PAC file is written in Javascript and it has ".cgi" extension. The code is: WebClient webClient = new…
angelo087
  • 51
  • 5
0
votes
1 answer

Can't get full url when setting local PAC file

I'm writing a .pac file for browser. I want browser to check url that i enter matches the rules. function FindProxyForURL(url, host) { url=url.toLowerCase(); host=host.toLowerCase(); debugPAC ="PAC Debug Information\n"; debugPAC…
0
votes
1 answer

how to read PAC file using C++

I am using libcurl for HTTP requests. My application should be able to understand the proxy settings if the user has any So it can be Proxy by proxy server or Proxy by Auto proxy Configuration I see support for PAC isnt available in libcurl Since…
linux developer
  • 821
  • 1
  • 13
  • 34
0
votes
1 answer

Does the VBA MSXML2 object support the use of a PAC file?

I am writing a VBA Excel add-in that uses the MSXML2 object to retrieve data over http. Not strictly a web browser; it just happens to be using the http protocol on port 80. I know that if the user's Internet Explorer is set up to use a proxy…
Josh
  • 4,412
  • 7
  • 38
  • 41
0
votes
0 answers

HttpWebRequest giving "target machine actively refused" error

I am trying to access a URI through HttpWebRequest and am getting the "target machine actively refused" error. I know from a machine that has no proxy this works fine and i know my corp internet uses a PAC file to determine the proxy however it…
user1371314
  • 762
  • 7
  • 24
-2
votes
1 answer

What is the different between PAC and MVC?

I have doubt about this two pattern, like MVC and PAC, which is more powerful for a web Application.
useCase
  • 1,265
  • 6
  • 22
  • 41
1 2 3
9
10