Proxy auto-config
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. These specifications cause the user agent to use a
particular proxy server or to connect directly.
Multiple specifications provide a fall-back when a proxy fails to
respond. The browser fetches this PAC file before requesting other URLs.
The URL of the PAC file is either configured manually or determined
automatically by the Web Proxy Autodiscovery Protocol.
Saya menggunakan Proxy Auto-Config atau PAC ini sebagai pengganti dari router (karena Saya menggunakan localhost), dengan cara memisahkan jalur yang akan dilalui. Di laptop Saya, Saya menggunakan 3 software proxy yaitu CCProxy, Handycache dan SQUID 2.7.STABLE7. CCProxy Saya gunakan untuk cache https, Handycache Saya gunakan untuk cache streaming dan SQUID 2.7.STABLE7 Saya gunakan untuk selain https dan cache streaming (untuk Localhost saya direct). Dibawah ini adalah contoh dari PAC yang saya gunakan.
//
// Proxy Auto-Config
//
// Fungsi
function FindProxyForURL(url, host)
{
// Localhost
if (dnsDomainIs(host, "*.local")||
dnsDomainIs(host, "localhost")||
isInNet(dnsResolve(host), "127.0.0.0", "255.255.255.0"))
{ return "DIRECT"; }
// Cache https (CCProxy)
if (url.substring(0,6)=="https:")
{ return "PROXY 127.0.0.1:808; DIRECT"; }
// Cache Streaming (Handycache)
if (dnsDomainIs(host, ".youtube.com")||
dnsDomainIs(host, "i1.ytimg.com")||
dnsDomainIs(host, ".googlevideo.com")||
dnsDomainIs(host, "video.ak.fbcdn.net")||
dnsDomainIs(host, ".vimeo.com")||
dnsDomainIs(host, ".soundcloud.com")||
dnsDomainIs(host, ".speedtest.net")||
dnsDomainIs(host, ".cdnst.net")||
shExpMatch(url, "*/speedtest/*"))
// Di failover
{ return "PROXY 127.0.0.1:8080; PROXY 127.0.0.1:3128; DIRECT"; }
// Cache image dll (SQUID 2.7.STABLE7)
else
// Di failover
{ return "PROXY 127.0.0.1:3128; PROXY 127.0.0.1:8080; DIRECT"; }
}
Sumber(Source) :
1. http://en.wikipedia.org/wiki/Proxy_auto-config
2. http://technet.microsoft.com/en-us/library/dd361918.aspx
3. http://www.proxypacfiles.com/proxypac/
4. http://www.google.com/search?q=Proxy+Auto-Config
Tidak ada komentar:
Posting Komentar