Index: includes/common.inc
===================================================================
RCS file: /home/cvsroot/drupal-4.5.2/includes/common.inc,v
retrieving revision 1.1
diff -u -r1.1 common.inc
--- includes/common.inc	3 Feb 2005 01:34:35 -0000	1.1
+++ includes/common.inc	7 Feb 2005 06:36:17 -0000
@@ -223,7 +223,14 @@
   $uri = parse_url($url);
   switch ($uri['scheme']) {
     case 'http':
-      $fp = @fsockopen($uri['host'], ($uri['port'] ? $uri['port'] : 80), $errno, $errstr, 15);
+      if (variable_get('proxy_name', '')) {
+        // Use proxy settings.
+        $fp = @fsockopen(variable_get('proxy_name', ''), variable_get('proxy_port', ''));
+      } 
+      else {
+        $fp = @fsockopen($uri['host'], ($uri['port'] ? $uri['port'] : 80), $errno, $errstr, 15);
+      }
+      
       break;
     case 'https':
       // Note: Only works for PHP 4.3 compiled with OpenSSL.
@@ -257,8 +264,15 @@
     $defaults[$header] = $header .': '. $value;
   }
 
-  $request = $method .' '. $path ." HTTP/1.0\r\n";
+  // Use proxy settings.
+  if (variable_get('proxy_name', '')) {
+    $request = $method.' '.$uri['scheme'].'://'.$uri['host'].$path.' '."HTTP/1.1\r\n";  
+  }
+  else {
+    $request = "$method $path HTTP/1.0\r\n";
+  }
   $request .= implode("\r\n", $defaults);
+  
   $request .= "\r\n\r\n";
   if ($data) {
     $request .= $data ."\r\n";