[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Changing clients to automatically find their proxy?



I recently discovered that both Konqueror and Firefox have an proxy
setting for automatically finding the proxy configuration.  This seem
to be called "Web Access Protocol Discovery" by KDE.  Anyone know how
it work?  I suspect it fetches the proxy information from DHCP, using
the wpad-url option (252), which is already set in Skolelinux to point
to "http://www/wpad.dat";.

If we could get both KDE, Firefox, wget and apt to automatically
detect and use the proper proxy, we would avoid one more hardcoded
configuration on the clients, and make it easier to deploy the client
in a large scale site.  wget and apt seem to be a problem for such
usage, as neither can run JavaScript files as far as I know.

Here is a draft patch for debian-edu-config to enable it.  It is not
yet tested.  Anyone got any experience with this?

Index: debian/changelog
===================================================================
--- debian/changelog    (revision 42071)
+++ debian/changelog    (working copy)
@@ -20,6 +20,9 @@
     to http://www/wpad.dat, to make it easier to redirect using DNS.
     Add the wpad info to the DHCP packages sent on the thin client
     network too.
+  * Change iceweasel and KDE proxy settings to use "Web Access
+    Protocol Discovery" for proxy configuration, to avoid hardcoding
+    proxy settings on the clients.

  -- Petter Reinholdtsen <pere@debian.org>  Tue,  1 Jul 2008 19:35:40 +0200

Index: cf/cf.squid
===================================================================
--- cf/cf.squid (revision 42069)
+++ cf/cf.squid (working copy)
@@ -6,34 +6,6 @@

 editfiles:

-  debian.!standalone::
-    # Enable proxy by default, but drop it on standalone until squid is
-    # configured on standalone
-    { /etc/environment
-      AutoCreate
-      AppendIfNoSuchLine "http_proxy=http://webcache:3128";
-      AppendIfNoSuchLine "ftp_proxy=http://webcache:3128";
-    }
-
-  debian.installation.workstation::
-
-# Configure Proxy settings in iceweasel in separate file in
-# /usr/lib/iceweasel/defaults/pref/.
-    { /usr/lib/iceweasel/defaults/pref/debian-edu-proxy.js
-      BeginGroupIfNoSuchLine "// Proxy Settings"
-        AppendIfNoSuchLine '// Proxy Settings'
-        AppendIfNoSuchLine 'pref("network.proxy.ftp", "webcache");'
-        AppendIfNoSuchLine 'pref("network.proxy.ftp_port", 3128);'
-        AppendIfNoSuchLine 'pref("network.proxy.http", "webcache");'
-        AppendIfNoSuchLine 'pref("network.proxy.http_port", 3128);'
-        AppendIfNoSuchLine 'pref("network.proxy.ssl", "webcache");'
-        AppendIfNoSuchLine 'pref("network.proxy.ssl_port", 3128);'
-        AppendIfNoSuchLine 'pref("network.proxy.no_proxies_on", "localhost, 127.0.0.1, .intern");'
-        AppendIfNoSuchLine 'pref("network.proxy.type", 1);'
-      EndGroup
-    }
-
-
    debian.server::

     { /etc/squid/squid.conf
@@ -98,17 +70,37 @@
       EndGroup
     }

+  debian.!standalone::
+# Enable proxy for APT and command line tools.  Should be changed to
+# use "Web Access Protocol Discovery"
+    { /etc/environment
+      AutoCreate
+      AppendIfNoSuchLine "http_proxy=http://webcache:3128";
+      AppendIfNoSuchLine "ftp_proxy=http://webcache:3128";
+    }
+
+  debian.workstation.!standalone::
+# Enable automatic proxy setting Configure Proxy settings in iceweasel
+# in separate file in /usr/lib/iceweasel/defaults/pref/.  Not
+# including the file in the package because it probably should not be
+# enabled on standalone installations.  using "Web Access Protocol
+# Discovery" (WAPD).
+    { /usr/lib/iceweasel/defaults/pref/debian-edu-proxy.js
+      AutoCreate
+      BeginGroupIfNoSuchLine "// Proxy Settings"
+        AppendIfNoSuchLine '// Proxy Settings'
+        AppendIfNoSuchLine 'pref("network.proxy.type", 4);'
+      EndGroup
+    }
+
 shellcommands:

   debian.workstation.!standalone::
+# Enable automatic proxy setting using "Web Access Protocol Discovery"
+# (WAPD).

-    # Stupid Konqueror do not use http_proxy and ftp_proxy.  Enable in
-    # config file.
-    "/usr/bin/update-ini-file /etc/kde3/kioslaverc 'Proxy Settings' ProxyType 1"
-    "/usr/bin/update-ini-file /etc/kde3/kioslaverc 'Proxy Settings' ftpProxy http://webcache:3128";
-    "/usr/bin/update-ini-file /etc/kde3/kioslaverc 'Proxy Settings' httpProxy http://webcache:3128";
-    "/usr/bin/update-ini-file /etc/kde3/kioslaverc 'Proxy Settings' httpsProxy http://webcache:3128";
-    "/usr/bin/update-ini-file /etc/kde3/kioslaverc 'Proxy Settings' NoProxyFor localhost,.intern,10.0.2.2"
+    "/usr/bin/update-ini-file /etc/kde3/kioslaverc 'Proxy Settings' ProxyType 3"
+    "/usr/bin/update-ini-file /etc/kde3/kioslaverc 'Proxy Settings' AuthMode 0"

 files:
 # Make sure every user can read the proxy config for KDE


Reply to: