WPAD script for those in need (squid related)



  • Perhaps someone will need simple ease of access to this script for wpad.dat, wpad.da & proxy.pac (NOTE: same script used in ALL the files named and ALL placed on pfsense in the  usr/local/www directory). Needed for enabling autoconfig in browsers that is part of the process with squid.

    function FindProxyForURL(url, host)
    {
       if (isInNet(host, "10.10.0.0", "255.255.0.0")) {
          return "DIRECT";
       } else {
          if (shExpMatch(url, "http:*")) 
             return "PROXY 192.168.1.1:3128" ;
          if (shExpMatch(url, "https:*"))
             return "PROXY 192.168.1.1:3128" ;
          if (shExpMatch(url, "ftp:*"))
             return "PROXY 192.168.1.1:3128" ;
          return "DIRECT";
       }
    }
    

    Replace the 192.168.1.1 (if needed) to reflect your pfsense address.

    CHEERS


Log in to reply