#6701 [Opn->Csd]: Use of http_proxy for fopen("http:// ...

From: Date: Wed, 03 Dec 2003 05:36:53 +0000
Subject: #6701 [Opn->Csd]: Use of http_proxy for fopen("http:// ...
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-51610@lists.php.net to get a copy of this message
ID: 6701 Updated by: pollita@php.net Reported By: mbabcock at fibrespeed dot net -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: Customized RedHat 6.2 PHP Version: 4.0.0 New Comment: This feature has been added to PHP 5.0.0 Example Usage: <?php $context = stream_context_create( array('http'=> array('proxy'=>'tcp://proxy.example.com:5100') )); $contents = file_get_contents('http://www.somesite.com/pat/to/file', false, $context); Previous Comments: ------------------------------------------------------------------------ [2002-01-06 09:58:22] jan@php.net although the request should remain open, this specific problem can be solved using PEAR::Cache. ------------------------------------------------------------------------ [2000-09-12 23:39:12] mbabcock at fibrespeed dot net It would be nice if fopen("http://www.mywebsite.com", "r"); used the value in http_proxy as a proxy server instead of always fetching the data directly. Using CURL is an option, but its a lot more complex. If this functionality isn't too difficult to achieve, it would be much appreciated. For example, I have a PHP program that HTMLizes RFCs and displays them. It grabs the rfc###.txt directly from http://www.ietf.org/ but there's no reason for it to refetch them every time if they can be cached by our proxy server. Note: blanking $http_proxy should disable the proxy. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=6701&edit=1

« previous php.bugs (#51610) next »