diff -ru drupal-4.1.0/includes/common.inc /home/vhost/csus.ug.cs.usyd.edu.au/htdocs/includes/common.inc
--- drupal-4.1.0/includes/common.inc	Mon Apr 14 06:00:03 2003
+++ /home/vhost/csus.ug.cs.usyd.edu.au/htdocs/includes/common.inc	Fri May  9 11:47:52 2003
@@ -793,6 +793,46 @@
   }
 }
 
+// XF: proxy aware fopen
+//
+// UG network doesn't permit outbound http connections directly, so
+// they must be proxified.
+function proxy_fopen($url, $mode) {
+  if (variable_get("httpproxy_host", "") == "") {
+    return fopen($url, $mode);
+  }
+  $proxy = variable_get("httpproxy_host", "");
+  $proxyport = variable_get("httpproxy_port", 3128);
+  $proxyuser = variable_get("httpproxy_user", "");
+  $proxypassword = variable_get("httpproxy_password", "");
+  $rsock = fsockopen($proxy, $proxyport, &$errno, &$errstr);
+  if ($rsock) {
+    fputs($rsock, "GET ".$url." HTTP/1.0\r\n");
+    if ("" != $proxyuser) {
+      $authtoken = base64_encode($proxyuser.":".$proxypassword); 
+      fputs($rsock, "Proxy-Authorization: Basic ".$authtoken."\r\n");
+    }
+    fputs($rsock, "\r\n");
+
+    $reply = fgets($rsock, 1024);
+    $ra = explode(" ", $reply, 3);
+    if ($ra[1] != 200) {
+      fclose($rsock);
+      return NULL;
+    }
+    // now, remove headers
+    while (1) {
+      $line = fgets($rsock, 1024);
+      if (trim($line) == "") {
+	break;
+      }
+    }
+    return $rsock;
+  }
+  return NULL;
+}
+
+
 // set error handler:
 set_error_handler("error_handler");
 
diff -ru drupal-4.1.0/modules/import.module /home/vhost/csus.ug.cs.usyd.edu.au/htdocs/modules/import.module
--- drupal-4.1.0/modules/import.module	Sat Mar 29 20:00:02 2003
+++ /home/vhost/csus.ug.cs.usyd.edu.au/htdocs/modules/import.module	Fri May  9 11:26:38 2003
@@ -226,7 +226,7 @@
   ** Grab the news items:
   */
 
-  if ($fp = @fopen($feed["url"], "r")) {
+  if ($fp = @proxy_fopen($feed["url"], "r")) {
     // fetch data:
     while (!feof($fp)) {
       $data .= fgets($fp, 128);
@@ -465,7 +465,7 @@
 
   set_time_limit(180);
 
-  if ($fp = @fopen($edit["url"], "r")) {
+  if ($fp = @proxy_fopen($edit["url"], "r")) {
     // fetch data:
     while (!feof($fp)) {
       $data .= fgets($fp, 128);
diff -ru drupal-4.1.0/modules/system.module /home/vhost/csus.ug.cs.usyd.edu.au/htdocs/modules/system.module
--- drupal-4.1.0/modules/system.module	Fri Jan 24 08:57:08 2003
+++ /home/vhost/csus.ug.cs.usyd.edu.au/htdocs/modules/system.module	Fri May  9 11:32:47 2003
@@ -74,6 +74,15 @@
   $output .= form_select(t("Date format"), "date_format", variable_get("date_format", "m/d/Y - H:i"), array("m/d/Y - H:i" => "m/d/Y - H:i", "d/m/Y - H:i" => "d/m/Y - H:i", "Y/m/d - H:i" => "Y/m/d - H:i"), t("The format in which dates are displayed"));
   $output .= "<hr />\n";
 
+  // http-proxy settings:
+  // XF: added to support proxy.
+  $output .= "<h3>" . t("HTTP Proxy settings") . "</h3>\n";
+  $output .= form_textfield(t("HTTP Proxy Host"), "httpproxy_host", variable_get("httpproxy_host", ""), 55, 55, t("The hostname of the HTTP proxy to use (blank for none)."));
+  $output .= form_textfield(t("HTTP Proxy Port"), "httpproxy_port", variable_get("httpproxy_port", 3128), 6, 6, t("The port of the HTTP proxy to use."));
+  $output .= form_textfield(t("HTTP Proxy Username"), "httpproxy_user", variable_get("httpproxy_user", ""), 20, 20, t("The username to use to authenticate with the proxy (blank for none)."));
+  $output .= form_password(t("HTTP Proxy Password"), "httpproxy_password", variable_get("httpproxy_password", ""), 55, 55, t("The password to use to authenticate with the proxy."));
+  $output .= "<hr />\n";
+
   // layout settings:
   $output .= "<h3>" . t("Layout settings") . "</h3>\n";
   foreach (theme_list() as $key => $value) $options .= "<option value=\"$key\"". (variable_get("theme_default", 0) == $key ? " selected=\"selected\"" : "") .">$key</option>\n";
