WPAD.dat /proxy.pac problem

  • Hello,
    I use Pfsense2.3.

    The configuration of my hardware is the following:
    A firewall departure: a LAN (WLAN 10.0.11.x not [wireless] 10.0.12.x) non transparent proxy (without authentication) is operational on 2 interfaces offices and a captive portal is Installed on the WLAN.

    I SINCE few days the following problem:
    When I configure Firefox in the manual mode on any WLAN Works well (captive portal authentication and proxy redirection)

    [Manual proxy configuration:
    HTTP proxy: –------- Port: 8080

    No proxy for:,]

    But not when I Initiation proxy.pac or wpad.dat with the Next line, nothing works:

    FindProxyForURL function (url, host)
    if (shExpMatch (url, "*"))
    {Return "DIRECT";}
    {Return "PROXY";}

    This code is probably wrong I really struggle with wpad file despite the doc on the internet if anyone knows transcribe my manual config file or proxy.pac wpad and squeezed it nice.

    Thank you in advance for the help :)

  • This is a generic wpad that exempts all private address space

    function FindProxyForURL(url,host)
    // If the requested website is hosted within the internal network, send direct.
        if (isPlainHostName(host) ||
            shExpMatch(host, "*.local") ||
            isInNet(dnsResolve(host), "", "") ||
            isInNet(dnsResolve(host), "",  "") ||
            isInNet(dnsResolve(host), "",  "") ||
            isInNet(dnsResolve(host), "", ""))
            return "DIRECT";
    // Else use the proxy
        return "PROXY";

  • Thank you for helping me :)
    Unfortunately this code, it doen't work I only accesses a page of my captive portal after authentification, I can't have access to the proxy (from wireshark).

  • I can assure you it works perfectly.  Perhaps you have a configuration issue or something else going on.

  • I believe you for the code, thank you again. I think the problem is in the redirection of the captive portal to proxy, according wireshark my connexion stay on (wlan) and don't go to the proxy. I don't know why ? while the manual configuration of Firefox work :/

  • I've never used captive portal so I can't help you there.

Log in to reply