From af155f3368509a2bc6edc7df0614107f0b7f26ba Mon Sep 17 00:00:00 2001 From: arino Date: Wed, 24 Sep 2003 09:41:38 +0900 Subject: [PATCH] =?utf8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E8=AA=8D=E8=A8=BC?= =?utf8?q?=E4=BB=98=E3=81=8Dproxy=E3=81=B8=E3=81=AE=E5=AF=BE=E5=BF=9C=20-?= =?utf8?q?=20sha=E3=81=95=E3=82=93=E6=8F=90=E4=BE=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- proxy.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/proxy.php b/proxy.php index 005d0fb..753081b 100644 --- a/proxy.php +++ b/proxy.php @@ -2,7 +2,7 @@ ///////////////////////////////////////////////// // PukiWiki - Yet another WikiWikiWeb clone. // -// $Id: proxy.php,v 1.2 2003/08/04 01:54:19 arino Exp $ +// $Id: proxy.php,v 1.3 2003/09/24 00:41:38 arino Exp $ // /* @@ -17,6 +17,7 @@ function http_request($url,$method='GET',$headers='',$post=array()) { global $use_proxy,$proxy_host,$proxy_port; + global $need_proxy_auth,$proxy_auth_user,$proxy_auth_pass; $rc = array(); $arr = parse_url($url); @@ -36,6 +37,12 @@ function http_request($url,$method='GET',$headers='',$post=array()) $query .= "Host: ".$arr['host']."\r\n"; $query .= "User-Agent: PukiWiki/".S_VERSION."\r\n"; + // proxy¤ÎBasicǧ¾Ú + if ($need_proxy_auth and isset($proxy_auth_user) and isset($proxy_auth_pass)) + { + $query .= 'Proxy-Authorization: Basic '. + base64_encode($proxy_auth_user.':'.$proxy_auth_pass)."\r\n"; + } // Basic ǧ¾ÚÍÑ if (isset($arr['user']) and isset($arr['pass'])) { @@ -83,7 +90,7 @@ function http_request($url,$method='GET',$headers='',$post=array()) $response = ''; while (!feof($fp)) { - $response .= fgets($fp,4096); + $response .= fread($fp,4096); } fclose($fp); -- 2.11.0