HTTPS Proxy & php

beshoo <[email protected]> Sun, 5 Feb 2017 06:33:54 +0200
Newsgroups gmane.comp.web.curl.php
Message-ID <CANHLsb0htUV2hS3NEkTMgtyELWKdz2Gk5vWsAWRRJDR7Pw_05A@mail.gmail.com>
--===============0549346995==
Content-Type: multipart/alternative; boundary=94eb2c043d7af7b0a10547c1062a

--94eb2c043d7af7b0a10547c1062a
Content-Type: text/plain; charset=UTF-8

Dear all ,

My curl
curl 7.52.1 (x86_64-redhat-linux-gnu) libcurl/7.52.1 OpenSSL/1.0.1e
zlib/1.2.3 c-ares/1.12.0 libssh2/1.8.0 nghttp2/1.6.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3
pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL
libz HTTP2 UnixSockets HTTPS-proxy Metalink

which is suport HTTPS proxy AFAIK.

Please advice how can i use *HTTPS* Proxy in php ?

i use this code but it dos not works !

$ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
*    curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');*
    curl_setopt($ch, CURLOPT_PROXY, $proxy_ip);
    curl_setopt($ch, CURLOPT_PROXYUSERPWD, $auth);
    $data = curl_exec($ch);
    curl_close($ch);


Regards

--94eb2c043d7af7b0a10547c1062a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><span style=3D"font-size:12.8px">Dear all ,=C2=A0</span><d=
iv style=3D"font-size:12.8px"><br></div><div style=3D"font-size:12.8px">My =
curl=C2=A0</div><div style=3D"font-size:12.8px"><div>curl 7.52.1 (x86_64-re=
dhat-linux-gnu) libcurl/7.52.1 OpenSSL/1.0.1e zlib/1.2.3 c-ares/1.12.0 libs=
sh2/1.8.0 nghttp2/1.6.0</div><div>Protocols: dict file ftp ftps gopher http=
 https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps t=
elnet tftp</div><div>Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SP=
NEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy Metalink</div><div=
><br></div><div>which is suport HTTPS proxy AFAIK.</div></div><div style=3D=
"font-size:12.8px"><br></div><div style=3D"font-size:12.8px">Please advice =
how can i use *HTTPS* Proxy in php ?</div><div style=3D"font-size:12.8px"><=
br></div><div style=3D"font-size:12.8px">i use this code but it dos not wor=
ks !</div><div style=3D"font-size:12.8px"><div>=C2=A0 =C2=A0=C2=A0</div><di=
v>$ch =3D curl_init();</div><div>=C2=A0 =C2=A0 curl_setopt($ch, CURLOPT_URL=
, $url);</div><div>=C2=A0 =C2=A0 curl_setopt($ch, CURLOPT_HEADER, 0);</div>=
<div>=C2=A0 =C2=A0 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);</div><div>=
=C2=A0 =C2=A0 curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);</div><div><=
b>=C2=A0 =C2=A0 curl_setopt($ch, CURLOPT_PROXYTYPE, &#39;HTTP&#39;);</b></d=
iv><div><b>=C2=A0 =C2=A0=C2=A0</b>curl_setopt($ch, CURLOPT_PROXY, $proxy_ip=
);</div><div>=C2=A0 =C2=A0 curl_setopt($ch, CURLOPT_PROXYUSERPWD, $auth);</=
div><div>=C2=A0 =C2=A0 $data =3D curl_exec($ch);</div><div>=C2=A0 =C2=A0 cu=
rl_close($ch);</div></div><div style=3D"font-size:12.8px"><br></div><div st=
yle=3D"font-size:12.8px"><br></div><div style=3D"font-size:12.8px">Regards<=
/div></div>

--94eb2c043d7af7b0a10547c1062a--

--===============0549346995==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaHR0cHM6Ly9j
b29sLmhheHguc2UvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL2N1cmwtYW5kLXBocAo=

--===============0549346995==--