dzanre1 Absent Member.
Absent Member.
4848 views

proxy.pac file with Firefox 3.x on a Mac

Is anyone else using a proxy.pac file for Firefox 3.x on a Mac? I'm able to
get the proxy.pac file to work by using url variables (for example, use a
proxy going to amazon.com, don't use one going to www.caledonia.net, etc.),
or even just making the proxy "on" all of the time unless a url variable is
hit, but the "proxy if PC is on local lan" doesn't work. My googling seems
to suggest that Firefox 3.x is seeing the ipv6 address, and not the ipv4
address, and that if I were to replace the

if (isInNet(myIpAddress(), "192.168.100.0", "255.255.255.0"))

with

if (isInNet(myIpAddress(), "192.168.100.0", "255.255.255.0") ||
shExpMatch(myIpAddress(), "fe80::21e:52ff:fe70:*") )

then it would work. But it still doesn't. I can't get the proxy to happen
based on my IP address. (oh and of course that ipv6 string in the shExpMatch
is the beginning of my ipv6 address).

So I'm wondering if it's just not possible. So, if anyone else knows the
definitive answer it would keep me from fussing with this and give me one
less thing to divert me from writing today 🙂

Thanks.

--
Danita
Novell Knowledge Partner
Moving GroupWise to Linux?
http://www.caledonia.net/gwmove.html
0 Likes
8 Replies
Anonymous_User Absent Member.
Absent Member.

Re: proxy.pac file with Firefox 3.x on a Mac

This website is great for reference

http://www.findproxyforurl.com/pac_functions_explained.html

METHOD ONE

=============================================

function FindProxyForURL(url, host){ // Trying to save localhost if
(localHostOrDomainIs(host, "localhost")) return "DIRECT"; if shExpMatch
(url, "http://localhost*") return "DIRECT";// If specific URL needs to
bypass proxy, send traffic direct.var resolved_ip = dnsResolve(host);if
(isInNet(resolved_ip, "172.22.145.0", "255.255.255.0") ||
isInNet(resolved_ip, "192.168.1.0", "255.255.255.0") ||
isInNet(resolved_ip, "127.0.0.1", "255.255.255.255"))return "DIRECT";return
"PROXY <proxy address here>:8080; DIRECT";}METHOD TWO

==================================

function FindProxyForURL(url, host) {
if (dnsDomainIs(host, "caledonia.net") ||

dnsDomainIs(host, "somotherhost.com")) {

return "PROXY proxyaddress:port ; DIRECT"
}

return "DIRECT";
}

++++++++++++++++++++++++++++++++++++++++++++++++

"DZanre" <dzanre@no-mx.forums.novell.com> wrote in message
news:gemini.kozo9j0000b4h00b4.dzanre@no-mx.forums.novell.com...
> Is anyone else using a proxy.pac file for Firefox 3.x on a Mac? I'm able
> to
> get the proxy.pac file to work by using url variables (for example, use a
> proxy going to amazon.com, don't use one going to www.caledonia.net,
> etc.),
> or even just making the proxy "on" all of the time unless a url variable
> is
> hit, but the "proxy if PC is on local lan" doesn't work. My googling
> seems
> to suggest that Firefox 3.x is seeing the ipv6 address, and not the ipv4
> address, and that if I were to replace the
>
> if (isInNet(myIpAddress(), "192.168.100.0", "255.255.255.0"))
>
> with
>
> if (isInNet(myIpAddress(), "192.168.100.0", "255.255.255.0") ||
> shExpMatch(myIpAddress(), "fe80::21e:52ff:fe70:*") )
>
> then it would work. But it still doesn't. I can't get the proxy to
> happen
> based on my IP address. (oh and of course that ipv6 string in the
> shExpMatch
> is the beginning of my ipv6 address).
>
> So I'm wondering if it's just not possible. So, if anyone else knows the
> definitive answer it would keep me from fussing with this and give me one
> less thing to divert me from writing today 🙂
>
> Thanks.
>
> --
> Danita
> Novell Knowledge Partner
> Moving GroupWise to Linux?
> http://www.caledonia.net/gwmove.html



0 Likes
dzanre1 Absent Member.
Absent Member.

Re: proxy.pac file with Firefox 3.x on a Mac

incognito wrote:

> This website is great for reference


well, it's not helping my particular problem though - i.e., if I'm in the
network 192.168.100.0 then use the proxy, otherwise don't. I can get any
other type of query I try to work (i.e., avoiding the proxy on some
addresses, forcing it on others), but I can't get it to force me to the
proxy if I'm on my local lan (and I've tried so many variations of the
if/else syntaxes that I'm blue in the face). Of course this would be useful
since it's a Macbook, and I wouldn't need to keep turning my proxy on and
off when I'm away from the house!

Oh well, I really do need to get back to my book, so I'll try this again
later when I can afford the silly distraction <heehee>.

--
Danita
Novell Knowledge Partner
Moving GroupWise to Linux?
http://www.caledonia.net/gwmove.html
0 Likes
Knowledge Partner
Knowledge Partner

Re: proxy.pac file with Firefox 3.x on a Mac

On 26/08/2009 15:58, DZanre wrote:

> Is anyone else using a proxy.pac file for Firefox 3.x on a Mac? I'm able to
> get the proxy.pac file to work by using url variables (for example, use a
> proxy going to amazon.com, don't use one going to www.caledonia.net, etc.),
> or even just making the proxy "on" all of the time unless a url variable is
> hit, but the "proxy if PC is on local lan" doesn't work. My googling seems
> to suggest that Firefox 3.x is seeing the ipv6 address, and not the ipv4
> address, and that if I were to replace the


Do you need IPv6?

If not, disable it in Firefox via about:config and search for ipv6.
Preference name is actually 'network.dns.disableIPv6'.

HTH
--
Simon

------------------------------------------------------------------------
Do you work with Novell technologies at a university, college or school?
If so, your campus could benefit from joining the Novell Technology
Transfer Partners (TTP) group. See www.novell.com/ttp for more details.
------------------------------------------------------------------------
0 Likes
dzanre1 Absent Member.
Absent Member.

Re: proxy.pac file with Firefox 3.x on a Mac

Simon Flood wrote:

> Do you need IPv6?
>
> If not, disable it in Firefox via about:config and search for ipv6.
> Preference name is actually 'network.dns.disableIPv6'.


I don't - I shall try that! Thanks.

--
Danita
Novell Knowledge Partner
Moving GroupWise to Linux?
http://www.caledonia.net/gwmove.html
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: proxy.pac file with Firefox 3.x on a Mac

Ahhh your using Vista I presume .... the easy method works on XP

I got my info from here

http://support.mozilla.com/tiki-view_forum_thread.php?locale=tr&comments_parentId=259063&forumId=1

"DZanre" <dzanre@no-mx.forums.novell.com> wrote in message
news:gemini.kozo9j0000b4h00b4.dzanre@no-mx.forums.novell.com...
> Is anyone else using a proxy.pac file for Firefox 3.x on a Mac? I'm able
> to
> get the proxy.pac file to work by using url variables (for example, use a
> proxy going to amazon.com, don't use one going to www.caledonia.net,
> etc.),
> or even just making the proxy "on" all of the time unless a url variable
> is
> hit, but the "proxy if PC is on local lan" doesn't work. My googling
> seems
> to suggest that Firefox 3.x is seeing the ipv6 address, and not the ipv4
> address, and that if I were to replace the
>
> if (isInNet(myIpAddress(), "192.168.100.0", "255.255.255.0"))
>
> with
>
> if (isInNet(myIpAddress(), "192.168.100.0", "255.255.255.0") ||
> shExpMatch(myIpAddress(), "fe80::21e:52ff:fe70:*") )
>
> then it would work. But it still doesn't. I can't get the proxy to
> happen
> based on my IP address. (oh and of course that ipv6 string in the
> shExpMatch
> is the beginning of my ipv6 address).
>
> So I'm wondering if it's just not possible. So, if anyone else knows the
> definitive answer it would keep me from fussing with this and give me one
> less thing to divert me from writing today 🙂
>
> Thanks.
>
> --
> Danita
> Novell Knowledge Partner
> Moving GroupWise to Linux?
> http://www.caledonia.net/gwmove.html



0 Likes
dzanre1 Absent Member.
Absent Member.

Re: proxy.pac file with Firefox 3.x on a Mac

DZanre wrote:

> I don't - I shall try that! Thanks.


Still no go - here's the entirety of my proxy.pac file:

function FindProxyForURL(url, host)
{
// variable strings to return
var proxy_yes = "PROXY 192.168.100.225:8080";
var proxy_no = "DIRECT";
if (shExpMatch(url, "*.ipaddressworld.com*")) { return proxy_yes; }
if (shExpMatch(url, "*.whatsmyip.org*")) { return proxy_no; }
if (shExpMatch(url, "*192.168.100.*")) { return proxy_no; }
// Proxy if PC is on local LAN
if (isInNet(myIpAddress(), "192.168.100.0", "255.255.255.0")) { return
proxy_yes; }
{ return proxy_no; }
}

I've also replaced the "if" statement with this:

if (isInNet(myIpAddress(), "192.168.100.0", "255.255.255.0"))
return "PROXY 192.168.100.225:8080";
else
return "DIRECT";

and that doesn't work either. Everything else works, and if I just change
the last line to { return proxy_yes; } then all of the url matching above
continues to work, of course, and I'm forced to the proxy.

Either I'm just overlooking something obvious, or it just won't work!

--
Danita
Novell Knowledge Partner
Moving GroupWise to Linux?
http://www.caledonia.net/gwmove.html
0 Likes
dzanre1 Absent Member.
Absent Member.

Re: proxy.pac file with Firefox 3.x on a Mac

incognito wrote:

> Ahhh your using Vista I presume .... the easy method works on XP


No - I'm using a Mac <g>!

--
Danita
Novell Knowledge Partner
Moving GroupWise to Linux?
http://www.caledonia.net/gwmove.html
0 Likes
Knowledge Partner
Knowledge Partner

Re: proxy.pac file with Firefox 3.x on a Mac

On 26/08/2009 17:03, DZanre wrote:

> I don't - I shall try that! Thanks.


If you're not using IPv6 have you disabled it on your Mac via System
Preferences | Network | Advanced... | TCP/IP?
--
Simon

------------------------------------------------------------------------
Do you work with Novell technologies at a university, college or school?
If so, your campus could benefit from joining the Novell Technology
Transfer Partners (TTP) group. See www.novell.com/ttp for more details.
------------------------------------------------------------------------
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.