Home » HTTP » HTTP_Request » Bug #5966
trying to get page through proxy when the request's server is a loopback
Details
| Request #5966 | trying to get page through proxy when the request's server is a loopback |
|---|---|
| Submitted | 2005-11-15 10:32 UTC |
| From | ptc1982 at ifrance dot com |
| Status | Wont fix |
| Package | HTTP_Request |
| PHP Version | 5.0.0 |
| OS | win 2000 |
| Roadmaps | (Not assigned) |
Comments
[2005-11-15 10:32 UTC] ptc1982 at ifrance dot com
Description:
------------
sendRequest function don't check if the server of the url requested is a loopback (localhost or 127.0.0.1).
So proxy server send a Connexion refused (503).
Test script:
---------------
define( 'PROXYNAME', 'proxy.example.com' );
define( 'PROXYPORT', '3128' );
$urlComplete = "http://127.0.0.1/foo.txt";
$req = &new HTTP_Request($urlComplete);
$req->setMethod(HTTP_REQUEST_METHOD_GET);
$req->setProxy(PROXYNAME,PROXYPORT);
$x = $req->sendRequest();
if (PEAR::isError($x)) {
echo "Problem";
die('');
}
if( $req->getResponseCode() == 503 ){
echo "connexion refused";
die('');
}
echo "get on localhost";
Expected result:
----------------
result of the script above
"get on localhost"
HTTP request must skip proxy server if 127.0.0.1
Actual result:
--------------
result of the script above
"connexion refused"
[2005-11-15 14:15 UTC] ptc1982 at ifrance dot com
ok, thanks you.
Sorry, for the inconvenience.