PHP Classes

Permanent Error with proxies

Recommend this page to a friend!

      PHP HTTP protocol client  >  All threads  >  Permanent Error with proxies  >  (Un) Subscribe thread alerts  
Subject:Permanent Error with proxies
Summary:Switch from bad-proxy to next proxy
Messages:5
Author:alex
Date:2009-04-01 19:02:34
Update:2009-04-02 06:11:11
 

  1. Permanent Error with proxies   Reply   Report abuse  
Picture of alex alex - 2009-04-01 19:02:34
When I try to use a proxy in a loop, and getting a bad proxy, then the class does not proceed to the next
proxy, and gives the same error.
Debug report:

Test for Manuel Lemos' PHP HTTP class

(now use proxy N 0 - 124.138.92.206:14124)

Opening connection to:

Connecting to Connecting to HTTP proxy server IP 124.138.92.206 port 14124...
Error: 10060 could not connect to the host "124.138.92.206"


(now use proxy N 1 - 94.25.26.1:3128)

Opening connection to:
Error: 10060 could not connect to the host "124.138.92.206"


(now use proxy N 2 - 201.47.91.22:3128)

Opening connection to:
Error: 10060 could not connect to the host "124.138.92.206"


(now use proxy N 3 - 66.81.93.162:3128)

Opening connection to:
Error: 10060 could not connect to the host "124.138.92.206"

  2. Re: Permanent Error with proxies   Reply   Report abuse  
Picture of alex alex - 2009-04-01 19:55:06 - In reply to message 1 from alex
The each iteration in loop with next proxy name:host start before $http->Open($arguments) and finish after $http->Close();

while(......)
{

$error=$http->GetRequestArguments($url,$arguments);
$arguments["ProxyHostName"]=$proxyname;
$arguments["ProxyHostPort"]=proxyhost;

$error=$http->Open($arguments);
........
........
........
........
$http->Close();

}

  3. Re: Permanent Error with proxies   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-04-02 01:35:42 - In reply to message 1 from alex
This is odd. I would have to see the whole script to try to reproduce the problem.

  4. Re: Permanent Error with proxies   Reply   Report abuse  
Picture of alex alex - 2009-04-02 05:40:45 - In reply to message 3 from Manuel Lemos
Thanks for quick respond.
The problem is solved - just added $http->error=""; at the begin of loop.

  5. Re: Permanent Error with proxies   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-04-02 06:11:11 - In reply to message 4 from alex
I see. I just fixed the class to reset the internal error variable in GetRequestArguments. The new version was just uploaded. Thank you for reporting.