RE: [PEAR-DEV] Patch to go-pear : Proxy authentication
| From: | LIMBOURG Arnaud | Date: | Thu, 08 Aug 2002 14:08:40 +0000 |
| Subject: | RE: [PEAR-DEV] Patch to go-pear : Proxy authentication | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-8249@lists.php.net to get a copy of this message | ||
> Obviously your patch didn't make it through to the list. Could you
> please upload it somewhere so we can review it?
Since it is small i'll post it here:
117c117
< print "HTTP proxy (host:port), or Enter for none";
---
> print "HTTP proxy (http://host:port or
> http://user:pass@host:port), or
Enter for none";
469c469,471
< list($phost, $pport) = explode(":", $proxy);
---
> $tmp_proxy = parse_url($proxy);
> $phost = $tmp_proxy['host'];
> $pport = $tmp_proxy['port'];
488c490,498
< "User-Agent: go-pear\r\n\r\n";
---
> "User-Agent: go-pear\r\n";
>
> if (!empty($proxy) && $tmp_proxy['user'] != '') {
> $request .= 'Proxy-Authorization: Basic ' .
> base64_encode($tmp_proxy['user'] . ':' .
$tmp_proxy['pass']) . "\r\n";
> // print "\nauthenticating against proxy with : user =
${tmp_proxy['user']} \n";
> // print "and pass = ${tmp_proxy['pass']}\n";
> } // if
> $request .= "\r\n";