Re: Bug #1242: fopen through proxy
| From: | Sascha Schumann | Date: | Wed, 17 Mar 1999 14:29:16 +0000 |
| Subject: | Re: Bug #1242: fopen through proxy | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-4665@lists.php.net to get a copy of this message | ||
On Wed, Mar 17, 1999 at 01:49:13PM -0000, empgmma@brunel.ac.uk wrote:
> From: empgmma@brunel.ac.uk
> Operating system: Linux (Redhat 5.2)
> PHP version: 3.0.7
> PHP Bug Type: Feature/Change Request
> Bug description: fopen through proxy
>
> Could you please change fopen so that it goes through a proxy?
>
>
I admit supporting proxies would be a fancy feature. But, if you require this
functionality why not simply wrap it into a short class?
----
class proxy {
var $proxy_host = "proxy";
var $proxy_port = "3128";
function fopen($url) {
$f = fsockopen($this->proxy_host, $this->proxy_port);
if(!$f) return false;
while(fgets($f, 512) != ""); # skip HTTP header
return $f;
}
}
$c = new proxy;
$f = $c->fopen("protocol://host/path");
fpassthru($f);
----
--
Regards,
Sascha Schumann |
Consultant | finger sas@schell.de
| for PGP public key
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net