473,586 Members | 2,754 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.11 1";
$port = "8080";

$url = "http://www.myhost.com/folder/script.dll?vari able=hello";

$fp = fsockopen($prox y, $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?vari able=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 5538
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.11 1";
$port = "8080";

$url = "http://www.myhost.com/folder/script.dll?vari able=hello";

$fp = fsockopen($prox y, $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?vari able=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
60589
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 http://xhaus.com/alan/python/proxies.html, but while many claim to support https, if you actually point your browser at the proxies, they work fine for http,...
22
6156
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 revisiting the project and need to update it to Python 2.4.1. python22-win32-ssl.zip isn't compatable (duh) and I can't find a newer version. I have had a...
0
991
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 connection" warning message on every page\postback. I'm 100% certain that all content is being delivered over https, i.e. all images etc in...
4
6504
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 method URLs. However, when we switched to using a secure connection, the call to webReference.SetUrl( "https://test.example.com..." ) no longer...
15
4585
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 communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never...
0
2439
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 http_proxy=http://user:passwd@host:port/ and https_proxy=$http_proxy i get a traceback : Traceback (most recent call last): File "test_urllib.py", line 2, in ?...
1
5062
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 to "dialogue" with web servers from a VB.Net app. It works fine as long as the server is a straightforward http server. I am able to retrieve pages...
2
2437
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 # server1.pl - a simple server use strict; use Socket;
6
2974
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 them. to be more clear we process this purpose we serve this to the student in the university. how?? student will send a message that contains his...
0
7911
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7954
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8215
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3836
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.