Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Firefox & http_proxy
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cwng
n00b
n00b


Joined: 21 Nov 2002
Posts: 68
Location: Singapore

PostPosted: Sat Apr 09, 2005 4:39 am    Post subject: Firefox & http_proxy Reply with quote

Hello,

Sorry if this seems a dumb question, but do anyone know how to make firefox or mozilla (and its derivatives) respect the environment setting of "http_proxy"?

I know you can mannually set the proxy in "Edit->Preferences->General->Connections", but I want to do it through environment variables. Reason being this is a laptop, and at home, my ISP recently force everybody to use their proxy for http connections. At work, or other places, proxy is not necessary. I do not want to go change the preferences setting everytime I fire up firefox.

I have already hacked up a script that will automatically set the "http_proxy" environment variable depedning on the DHCP address my laptop is assigned. However, firefox does not seems to respect that.

Any help or insights appreciated.

/rgds
/cwng
Back to top
View user's profile Send private message
jods
Tux's lil' helper
Tux's lil' helper


Joined: 14 Sep 2004
Posts: 83
Location: Patiala, Punjab.

PostPosted: Sat Apr 09, 2005 10:45 am    Post subject: Reply with quote

When you change your environmental setting make another change in the firefox proxy autoconfig script and specify this script in your firefox preferences.
Alternatively,
There is an extension for firefox known as switchproxy which makes changing proxies painless.

Jodhbir
_________________
My software has no bugs, it just develops unexplained random features.
Junkyard
Back to top
View user's profile Send private message
cwng
n00b
n00b


Joined: 21 Nov 2002
Posts: 68
Location: Singapore

PostPosted: Sun Apr 10, 2005 2:21 am    Post subject: Reply with quote

I see, thank you, jods.

I have did some research on the proxy autoconfig file, and found that in fact, I need not make any dynamic changes to the file at all. I could code the script to specify "PROXY foo.bar.com:8080" when myIPAddress is found to be in the home network, and otherwise returns "DIRECT".

Here is a very simple script I come up with, in case it helps some other people on this forum.

Code:
// Assuming home network address space is "172.18.0.0/16"
// Assuming home network proxy is "fol.singnet.com.sg:8080"
function FindProxyForUrl (url, host) {
    if (isInNet (myIPAddress, "172.18.0.0", "255.255.0.0")) {
        if (! isInNet (host, "172.18.0.0", "255.255.0.0")) {
            return "PROXY fol.singent.com.sg:8080";
        }
    }
    // all other cases, use direct
    return "DIRECT";
}
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum