diff -rup drupal-4.7.2-orig/includes/common.inc drupal-4.7.2-proxy/includes/common.inc --- drupal-4.7.2-orig/includes/common.inc 2006-05-15 22:53:26.000000000 +0200 +++ drupal-4.7.2-proxy/includes/common.inc 2006-06-26 23:07:27.000000000 +0200 @@ -368,7 +368,12 @@ function drupal_http_request($url, $head case 'http': $port = isset($uri['port']) ? $uri['port'] : 80; $host = $uri['host'] . ($port != 80 ? ':'. $port : ''); - $fp = @fsockopen($uri['host'], $port, $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'], $port, $errno, $errstr, 15); + } break; case 'https': // Note: Only works for PHP 4.3 compiled with OpenSSL. @@ -407,7 +412,11 @@ function drupal_http_request($url, $head $defaults[$header] = $header .': '. $value; } - $request = $method .' '. $path ." HTTP/1.0\r\n"; + 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) { diff -rup drupal-4.7.2-orig/modules/system.module drupal-4.7.2-proxy/modules/system.module --- drupal-4.7.2-orig/modules/system.module 2006-06-02 00:08:06.000000000 +0200 +++ drupal-4.7.2-proxy/modules/system.module 2006-06-26 23:07:41.000000000 +0200 @@ -263,7 +263,14 @@ function system_view_general() { '#type' => 'textfield', '#title' => t('Slogan'), '#default_value' => variable_get('site_slogan', ''), '#description' => t('The slogan of this website. Some themes display a slogan when available.') ); - + $form['general']['proxy_name'] = array( + '#type' => 'textfield', '#title' => t('Proxy hostname'), '#default_value' => variable_get('proxy_name', ''), + '#description' => t('The name of the http proxy-server if one is needed to access the outside world') + ); + $form['general']['proxy_port'] = array( + '#type' => 'textfield', '#title' => t('Proxy port'), '#default_value' => variable_get('proxy_port', ''), + '#description' => t('The port of the http proxy-server') + ); $form['general']['site_mission'] = array( '#type' => 'textarea', '#title' => t('Mission'), '#default_value' => variable_get('site_mission', ''), '#description' => t('Your site\'s mission statement or focus.')