0
votes

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 as explained in many guides. I ticked the automatic proxy settings and I then put pac file url.

After that I think the file is not being loaded. puting : "chrome://net-internals/#proxy" gives an empty list while it should show the pac file. Plus the net seems to work as the pac is not even there.

For further information, since I am new to pac file, I am just testing a simple pac file which redirect ALL traffic to youtube.com.

can anyone help me out? Thanks

function FindProxyForURL(url, host) {
  return "youtube.com";
1

1 Answers

0
votes

The format to return is something like return "PROXY youtube.com:80". However I do not think this will work, as Youtube is not a proxy.

PAC files must return a Proxy. But Youtube is just a site, which is something completely different than a Proxy.

PAC files are unable to replace a Proxy. All they do is to point to the proxy to use when you want to reach some specific URL. This way you can configure how to reach certain networks, like some Extranet (via some dedicated HTTP proxy or TOR or I2P (via SOCKS proxies). This is why you also must specify the type of the Proxy used and the port number where the Proxy sits. Just a name usually is not enough.

Also note that you can give more than just one Proxy. For more information on PAC-files see the main documentation:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_(PAC)_file

(Sorry for the link, but if a Link to MDN ever breaks, the Net probably has some bigger trouble than just this broken link.)