Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    WPAD.dat /proxy.pac problem

    Scheduled Pinned Locked Moved Cache/Proxy
    6 Posts 2 Posters 1.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Keyboardhunter
      last edited by

      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: 10.0.11.252 –------- Port: 8080

      USE THIS proxy server for all protocols

      |
      |
      |
      No proxy for:
      10.0.12.254:8002,]

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

      FindProxyForURL function (url, host)
      {
      if (shExpMatch (url, "10.0.12.254:8002/*"))
      {Return "DIRECT";}
      other
      {Return "PROXY 10.0.11.252:8080";}
      }

      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 :)

      1 Reply Last reply Reply Quote 0
      • KOMK
        KOM
        last edited by

        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), "10.0.0.0", "255.0.0.0") ||
                isInNet(dnsResolve(host), "172.16.0.0",  "255.240.0.0") ||
                isInNet(dnsResolve(host), "192.168.0.0",  "255.255.0.0") ||
                isInNet(dnsResolve(host), "127.0.0.0", "255.255.255.0"))
                return "DIRECT";
        // Else use the proxy
            return "PROXY 10.0.11.252:8080";
        }
        
        1 Reply Last reply Reply Quote 0
        • K
          Keyboardhunter
          last edited by

          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).

          1 Reply Last reply Reply Quote 0
          • KOMK
            KOM
            last edited by

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

            1 Reply Last reply Reply Quote 0
            • K
              Keyboardhunter
              last edited by

              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 10.0.12.252 (wlan) and don't go to the proxy. I don't know why ? while the manual configuration of Firefox work :/

              1 Reply Last reply Reply Quote 0
              • KOMK
                KOM
                last edited by

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

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.