View previous topic :: View next topic |
Author |
Message |
cwng n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 21 Nov 2002 Posts: 68 Location: Singapore
|
Posted: Sat Apr 09, 2005 4:39 am Post subject: Firefox & http_proxy |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
jods Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/17435322854247c68655b81.jpg)
Joined: 14 Sep 2004 Posts: 83 Location: Patiala, Punjab.
|
Posted: Sat Apr 09, 2005 10:45 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
cwng n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 21 Nov 2002 Posts: 68 Location: Singapore
|
Posted: Sun Apr 10, 2005 2:21 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|
|
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
|
|