473,327 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Need help with https socket proxy server connection

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 = "111.111.111.111";
$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");
while(!feof($fp)){
$line = fgets($fp, 9000);
}
fclose($fp);
print($line);
==========================================

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
b_******@ziplip.com
Jul 17 '05 #1
1 5505
Hello,

On 07/17/2004 12:54 PM, b_prikls wrote:
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 = "111.111.111.111";
$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");
while(!feof($fp)){
$line = fgets($fp, 9000);
}
fclose($fp);
print($line);
==========================================

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).


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:

http://www.phpclasses.org/httpclient
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Paul Sweeney | last post by:
Does anyone know of a working (python) https proxy which allows viewing of unencrypted data being sent from my browser to an https site? I've worked my way through most on the list at...
22
by: Bloke | last post by:
Hi all. Some time ago (years) I had a script on Python 2.2 that would retieve a HTTPS web site. I used python22-win32-ssl.zip to handle the SSL aspect and it worked wonderfully. I am...
0
by: Brian | last post by:
I have implemented a new ASP.NET web site and configured SSL on my proxy server (i.e. not the web server). When I navigate from page to page I get the "You are about to leave a secure internet...
4
by: Jason P | last post by:
Basically we have a web method with a dynamic URL. The client is developed in C++ and I've been using the webReference.SetUrl( "http://test.example.com..." ) method successfully with various web...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
0
by: Ali.Sabil | last post by:
hello all, I just maybe hit a bug in both urllib and urllib2, actually urllib doesn't support proxy authentication, and if you setup the http_proxy env var to...
1
by: Balex | last post by:
Hi This is a question for people who know and use the winhttp DLL from MS. I need to be able to simulate the entry by users of data into a web-based application. So I started with using winhttp...
2
by: vasu1308 | last post by:
Hi all I am working on a socket program in Perl. Main goal is to develop a proxy server. Here is the code attached. An error is encountered. Anyone Please help me out. #!/usr/bin/perl -w #...
6
by: zaina | last post by:
hi everybody i am nwebie in this forum but i think it is useful for me and the member are helpful my project is about connecting client with the server to start exchanging messages between...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.