|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-09-12 23:39 UTC] 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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 06:00:01 2025 UTC |
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);