php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #6701 Use of http_proxy for fopen("http:// ...
Submitted: 2000-09-12 23:39 UTC Modified: 2003-12-03 00:36 UTC
From: mbabcock at fibrespeed dot net Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.0 OS: Customized RedHat 6.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
8 + 50 = ?
Subscribe to this entry?

 
 [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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-06 09:58 UTC] jan@php.net
although the request should remain open, this specific problem can be solved using PEAR::Cache.
 [2003-12-03 00:36 UTC] pollita@php.net
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);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC