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 4 Feb 2005 04:27:55 -0000 @@ -223,7 +223,13 @@ $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', ''), '8080'); + } 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 +263,15 @@ $defaults[$header] = $header .': '. $value; } - $request = $method .' '. $path ." HTTP/1.0\r\n"; - $request .= implode("\r\n", $defaults); + //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";