| Advertise on warmetal.nl! Click for more information about advertising here. |
Did you find this website useful? Did I save you a lot of time? |
|
/*
* Standard proxy.pac automatic proxy configuration.
*
* sjoerd [@] warmetal.nl
* 22 aug 2008
*
* Will not proxy for short hostnames for domain.local and raw URL http://10.*
*
*/
function FindProxyForURL(url, host)
{
// If no domain name in the host(no dots) are found go DIRECT
if (isPlainHostName(host) || dnsDomainIs(host, ".domain.local"))
{
return "DIRECT";
}
else if (url.substring(0, 10) == "http://10." ||
url.substring(0, 11) == "https://10." ||
url.substring(0, 11) == "http://127." ||
url.substring(0, 12) == "https://127." )
{
return "DIRECT";
}
else
{
return "PROXY proxy:8080";
}
}
Note that you need a DNS record for the proxy
function FindProxyForURL(url, host)
{
// our local URLs from the domains below don't need a proxy:
if (shExpMatch(url, "*.wiki.5p-it.com*")) {
return "DIRECT";
} else {
// All other requests go through port 3128 of proxy.5p-it.com.
return "PROXY proxy.5p-it.com:3128";
}
}
cat /etc/apache2/default-server.conf | grep -i root DocumentRoot "/srv/www/htdocs"
Now you can enter an “automatic proxy configuration url” (firefox) or “Use automatic configuration script” (Internet explorer). The address would be:
http://proxy.5p-it.com/proxy.pac
Discussion