EFW Support

Support => EFW SMTP, HTTP, SIP, FTP Proxy Support => Topic started by: tuca on Tuesday 07 February 2012, 08:33:41 pm



Title: Problem wpad.dat
Post by: tuca on Tuesday 07 February 2012, 08:33:41 pm
Hallo
I have a problem with my network set wpad.dat. works.But the automatic proxy configuration from Endian not works. please help me.DNS Wpad ist work

function FindProxyForURL(url, host)
{
        if (isPlainHostName(host) || shExpMatch( url, "*192.168.2.1*" ) ) {
                return "DIRECT";
        }
        else if (host == "127.0.0.1") {
                return "DIRECT";
        }
        else if (isInNet(host, "192.168.2.0", "255.255.255.0")) {
                return "PROXY 192.168.2.1:8080; DIRECT";
        }
        else if (isInNet(host, "192.168.2.0", "255.255.255.0")) {
                return "PROXY 192.168.2.1:8080; DIRECT";
        }
        else {
                return "DIRECT";
        }
}


Title: Re: Problem wpad.dat
Post by: diego.pontes on Saturday 25 February 2012, 04:39:48 am
i'm also having the same problem, i did the setup to dhcp.


Title: Re: Problem wpad.dat
Post by: mrkroket on Saturday 25 February 2012, 06:18:06 am
I edited mine. It's for 2.4.0, but maybe works for any version.
You must create a backup of the file: /home/httpd/html/proxy.pac
And replace it with the attached pac file (just remove the ending .txt).

You can create custom pac rules on the file: /var/efw/proxy/proxy.custom.pac
For example, for local subnets and internal servers you must set all of them on internal:
Example of a proxy.custom.pac:
Code:
//PROXY PAC CUSTOM START
    if (isPlainHostName(host)) return "DIRECT";
    if ( host == "localhost" || host.substring(0,4) == "127." ) return "DIRECT";
    if ( url.substring(0, 5) == "file:" ) return "DIRECT";

    if (!isResolvable(host)) return "DIRECT";

    //Do not use proxy on loca subnets
    var resolved_ip = dnsResolve(host);
    if ((isInNet(resolved_ip, "192.168.0.0", "255.255.0.0")) ||
        (isInNet(resolved_ip, "10.0.0.0", "255.0.0.0")) ||
        (isInNet(resolved_ip, "172.16.0.0", "255.240.0.0")))
           {
       return "DIRECT";
           }

//  if (dnsDomainIs(host, "liveupdate.symantecliveupdate.com")) return "DIRECT";
//  if (dnsDomainIs(host, "liveupdate.symantec.com")) return "DIRECT";
//  if (dnsDomainIs(host, "update.symantec.com")) return "DIRECT";
//FIN DE PROXY PAC CUSTOM



Title: Re: Problem wpad.dat
Post by: diego.pontes on Monday 27 February 2012, 11:29:21 pm
With me didn't work correctly, i made the change, but don't work, i'll post my proxy.pac.


Title: Re: Problem wpad.dat
Post by: mrkroket on Tuesday 28 February 2012, 05:47:47 am
Use mine and add all custom proxy.pac configs on /var/efw/proxy/proxy.custom.pac.
Mine is standard, works for any zone and in transparent and non-transparent (at least I hope so).


Title: Re: Problem wpad.dat
Post by: turitopa on Wednesday 01 April 2015, 05:18:00 pm
mrkroket you are the man! 8)

i have looked all thru google for a fix for /home/httpd/html/proxy.pac file for endian 2.3! Solution is right here.
i got it working somehow for auto config, then just lat week it crapped out on me.  read all sorts of info about missing ")" etc. but no fix on how to correct the perl script!
your attached file works perfectly and now auto-config working (with custom rules;-) so that work laptops will auto configure both in and out of the work domain.
Kudos my  i have used a lot of your little remedies in the past also.

i had forgotten my password for this forum, needed it for this commemt ... and of course to DL your attached file!

yeaha!