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

    WPAD Syntax error?

    Scheduled Pinned Locked Moved Cache/Proxy
    2 Posts 2 Posters 7.4k 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.
    • MMapplebeckM
      MMapplebeck
      last edited by

      OK, I GIVE….. I know when it's time to ask for help.

      I've been trying to figure this out for the past week, attached below is my WPAD file, internal clients are not picking it up.  It is published by both DHCP and DNS.  When I check the Chrome traps, it tells me there is a syntax error on line 6, which is: '    if (isInNet(host, "172.16.0.0", "255.255.252.0"))', however, I have even had one of our senior software devs here check it out, and they say it all looks fine.  Wondering if anybody might have any further insight?
      Of course, I've tried 2 different validators, one works perfectly for each situation, the other gives me the same error on line 6.
      This file exists as wpad.dat, wpad.da, proxy.pac in the root of my lighttpd server.

      
      function FindProxyForURL(url, host) {
      
          if (isPlainHostName(host)) return "DIRECT";
      
      // Head Office
          if (isInNet(host, "172.16.0.0", "255.255.252.0"))
              return "PROXY 172.16.2.222:3128";
      
      // Data Center 1
          if (isInNet(host, "172.20.182.0", "255.255.255.192"))
              return "DIRECT";
      
      // Data Center 2
          if (isInNet(host, "172.20.193.0", "255.255.255.0"))
              return "DIRECT";
      
      // Regional Branch Office
          if (isInNet(host, "172.16.4.128", "255.255.255.128"))
              return "PROXY 172.16.4.234:3128";
      
      // International Branch Office
          if (isInNet(host, "172.16.5.128", "255.255.255.128"))
              return "PROXY 172.16.5.234:3128";
      
      // VPN
          if (isInNet(host, "10.123.234.0", "255.255.255.192"))
              return "DIRECT";
      
      // Default Rule
          else return "DIRECT";
      
      }
      
      
      1 Reply Last reply Reply Quote 0
      • K
        killmasta93
        last edited by

        hmm..allright lets start from the basic…

        1. could you first try just one LAN segment to see if its working first?
          Why dont you let WPAD run on pfSense? Did you add the 252 on the DHCP on windows server?

        can you do nslookup WPAD? this is my WPAD

        Also want to side note something about the VPN with OpenVPN theres issues see this...

        https://forums.openvpn.net/topic21290.html

        function FindProxyForURL(url, host) 
        { 
            if (isPlainHostName(host) ||
                shExpMatch(host, "*.local") ||
                isInNet(dnsResolve(host), "192.168.3.0",  "255.255.255.0"))
                return "DIRECT";
        
            return "PROXY 192.168.3.254:3128";
        }
        
        

        Capture.PNG
        Capture.PNG_thumb

        Tutorials:

        https://www.mediafire.com/folder/v329emaz1e9ih/Tutorials

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