<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>GuruBlog : Articles about firefox</title>
    <description>local-guru.net</description>
    <link>http://www.local-guru.net/blog</link>
    <ttl>40</ttl>
    <item>
      <title>automatic proxy configuration in firefox</title>
      <link>http://www.local-guru.net//blog/2007/11/3/automatic-proxy-configuration-in-firefox</link>
      <description>&lt;p&gt;In an erlier article i describe how to switch between the network environments i am
using, but there was one programm i could not convince to let me change the proxy
settings via apple script - firefox.&lt;/p&gt;

&lt;p&gt;i still needet to switch the firefox settings per hand - something i didnt like at all.&lt;/p&gt;

&lt;p&gt;one day the little "fetch proxy settings for url" dialog part from the
firefox proxysettigns made me courious and i found out, that firefox
expects a javascript file on this url, which tells firefox what proxy to use.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function FindProxyForURL(url, host) {
    if ( dnsResolve( host ) == "127.0.0.1" ) {
        return "DIRECT";
    } else {
        return "PROXY proxyhost:8080";
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;this script can use some predefined functions like "isInNet" or "dnsResolve" to
determine which network Im in and use the appropriate proxy. the file doesnt
even have to live on a http server, a file:// url is sufficient.&lt;/p&gt;

&lt;p&gt;e voila - no more manual proxy switching&lt;/p&gt;
</description>
      <pubDate>2007-11-03T15:43:00+01:00</pubDate>
    </item>
  </channel>
</rss>

