wenlong1423
12/8/2013 - 3:27 PM

Debug PAC File from http://findproxyforurl.com/debug-pac-file/

function FindProxyForURL(url, host) {
 
    debugPAC ="";
    debugPAC +="IP: " + myIpAddress();
    debugPAC +=", Hostname: " + host;
    if (isResolvable(host)) {resolvableHost = "True"} else {resolvableHost = "False"};
    debugPAC +=", Host Resolvable: " + resolvableHost;
    debugPAC +=", Hostname IP: " + dnsResolve(host);
    if (isPlainHostName(host)) {plainHost = "True"} else {plainHost = "False"};
    debugPAC +=", Plain Hostname: " + plainHost;
    debugPAC +=", Domain Levels: " + dnsDomainLevels(host);
    debugPAC +=", URL: " + url;
    debugPAC = "start" + debugPAC;
    // Protocol can only be determined by reading the entire URL.
    if (url.substring(0,5)=="http:") {protocol="HTTP";} else
        if (url.substring(0,6)=="https:") {protocol="HTTPS";} else
            if (url.substring(0,4)=="ftp:") {protocol="FTP";}
                else {protocol="Unknown";}
    debugPAC +="Protocol: " + protocol;
 
    // Reduce volume of alerts to a useable level, e.g. only alert on static text pages.
    if (!shExpMatch(url,"*.(js|xml|ico|gif|png|jpg|jpeg|css|swf)*")) {alert(debugPAC);}
 
    return "DIRECT";
}