<p dir="ltr">Look into the pacparser project on github. It allows you to evaluate a pac file and test the logic.</p>
<div class="gmail_quot<blockquote class=" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi All,<br><br></div><div>I have 2 issues<br><br></div><div>First one: How can i bypass proxy for an IP in LAN.<br></div><div><br><br></div>Second one: <br>I am running squid on openwrt and i want to allow some websites to bypass proxy and want to allow them go direct.<br></div>For that i am using wpad with PAC file but the problem is for some websites it works and for some it doesn't.<br><br></div>Here is my PAC file<br><br><br><br>function FindProxyForURL(url, host)<br>{<br> // The 1st if function tests if the URI should be by-passed<br> // Proxy By-Pass List<br> if (<br> // ignore RFC 1918 internal addreses<br> isInNet(host, "10.0.0.0", "255.0.0.0") ||<br> isInNet(host, "172.16.0.0", "255.240.0.0") ||<br> isInNet(host, "192.168.0.0", "255.255.0.0") ||<br><br> // is url is like <a href="http://server" target="_blank">http://server</a> by-pass<br> isPlainHostName(host) ||<br><br> // localhost!!<br> localHostOrDomainIs(host, "127.0.0.1") ||<br><br> // by-pass internal URLS<br> dnsDomainIs(host, ".<a href="http://flipkart.com" target="_blank">flipkart.com</a>") ||<br> dnsDomainIs(host, ".<a href="http://apple.com" target="_blank">apple.com</a>") ||<br> dnsDomainIs(host, ".<a href="http://linuxbite.com" target="_blank">linuxbite.com</a>") ||<br> dnsDomainIs(host, ".<a href="http://rediff.com" target="_blank">rediff.com</a>") ||<br><br> // by-pass FTP<br>// shExpMatch(url, "ftp:*")<br> url.substring(0, 4)=="ftp:"<br> )<br><br> // If True, tell the browser to go direct<br> return "DIRECT";<br><br> // If False, it's not on the by-pass then Proxy the request if you fail to connect to the proxy, try direct.<br><br>return "PROXY <a href="http://192.168.1.1:3128" target="_blank">192.168.1.1:3128</a>";<br>//return "DIRECT";<br>}<br><br><br><br></div>To be precise it works for <a href="http://apple.com" target="_blank">apple.com</a> but doesn't work for rest of the websites.<br></div>Please enlighten me.<br clear="all"><div><div><div><div><div><div><br>-- <br><div><div dir="ltr">Regards,<br>Yashvinder </div></div>
</div></div></div></div></div></div></div>
<br>_______________________________________________<br>
squid-users mailing list<br>
<a href="mailto:squid-users@lists.squid-cache.org">squid-users@lists.squid-cache.org</a><br>
<a href="http://lists.squid-cache.org/listinfo/squid-users" rel="noreferrer" target="_blank">http://lists.squid-cache.org/listinfo/squid-users</a><br>
<br></div>