Code example for curl to support sock5 in PHP, curlsock5_PHP tutorial

WBOY
Release: 2016-07-13 10:09:27
Original
829 people have browsed it

Code example for curl to support sock5 in PHP, curlsock5

Copy code The code is as follows:

//Recently, curl needs to be used to test whether the proxy is available. The proxy is sock5 and not http, so a few sentences need to be added to curl.

curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
curl_setopt($ch, CURLOPT_PROXY, "0.0.0.0:8080");
curl_setopt($ch,CURLOPT_PROXYUSERPWD, "username:pwd");

//The test is ok and the speed is very fast haha ​​

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/945709.htmlTechArticleCode example for curl to support sock5 in PHP, curlsock5 copy code code is as follows: //Recently need to use curl testing Is the proxy available? The proxy is sock5 but not http, so it needs to be added to curl...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template