Need help with https socket proxy server connection

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all,
i need your help, here is code, that makes http connection to a
website throu
a proxy server, and it works fine:

$proxy = "";
$port = "8080";

$url = " ";

           $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 = "";

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:
Quoted text here. Click to load it

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:


Manuel Lemos

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

Site Timeline