Archived Forum Post

Index of archived forum posts

Question:

Using php with http proxy fails

Nov 03 '16 at 18:57

I did try to use the http php-Extension for Linux which works just fine. But if I add a (working) Proxy, it can not get the file anymore.

Maybe I am using the Proxy functions wrong?

Case1:

//works
$success = $http->Download('www.jb-lighting.de/download/manual/40.pdf',$localFilePath);

Case2:

//does not work
$http->put_ProxyDomain("173.192.128.238");
$http->put_ProxyPort(25);
$success = $http->Download('www.jb-lighting.de/download/manual/40.pdf',$localFilePath);

Answer

I have tested with several Proxy and even different Port for each individual Proxy. No luck. Am I missing an important step again?


Answer

You need to pass a proper URL to Download. For example "http://www.jb-lighting.de/...." or "https://..."

You're missing the "http://"


Answer

Some IP do work & as well with Domain name. Some I need to enter with Domain, because the IP is not working. put_ProxyDomain did sometimes work with IP even without http://.

Does put_ProxyDomain("127.0.0.1") checkup it is localhost? And why is it sometimes not working (get Hostname from IP)?

This one currently works with both:

IP Address : 168.1.47.248

Location : Australia (95% accuracy)

Host Name : f8.2f.01a8.ip4.static.sl-reverse.com

$http->put_ProxyDomain("168.1.47.248");
$http->put_ProxyPort(8080);

and

$http->put_ProxyDomain("f8.2f.01a8.ip4.static.sl-reverse.com");
$http->put_ProxyPort(8080);

I did check with:

$html = $http->quickGetStr("www.whatismyip.com");