Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
July 17, 2004, 1:54 pm
rate this thread
i need your help, here is code, that makes http connection to a
a proxy server, and it works fine:
$proxy = "126.96.36.199";
$port = "8080";
$url = "http://www.myhost.com/folder/script.dll?variable=hello ";
$fp = fsockopen($proxy, $port, $errno, $errstr,5);
fputs($fp, "GET $url HTTP/1.0\r\nHost: $proxy\r\n\r\n");
$line = fgets($fp, 9000);
I need it to be able to make https connection, like that:
$url = "https://www.myhost.com/folder/script.dll?variable=hello";
For some reason it does not work. Proxy server does support https.
I am using http/https proxy server, but it can be changed to socks4/5
server, if its crucial. (i did that and it still does not work, no
data is returned).
Its driving me nuts, could someone please help me, i am even willing
to pay you.
Thank you very much
Re: Need help with https socket proxy server connection
On 07/17/2004 12:54 PM, b_prikls wrote:
The code is correct but depending on your PHP version you may be
affected by bugs in the feof function.
You may want to try this HTTP client class that support SSL requests
either via Curl library, OpenSSL or via non-SSL proxy as you are doing.
It implements some workarounds to the feof bugs. You can also use HTTP
1.1 (which is the default) and let the chunked encoding tell the class
exactly when the page ends:
PHP Classes - Free ready to use OOP components written in PHP
PHP Reviews - Reviews of PHP books and other products
Metastorage - Data object relational mapping layer generator