嗨,我正试图使用代理列表ip向网站发出请求,但我做不到。我在php中的cURL请求中不断收到一个错误。我哪里做错了?
$ request = curl_init ('https://www.webisite-request.com/');
curl_setopt ($ request, CURLOPT_PROXY, '102.xxx.xx.xx');
curl_setopt ($ request, CURLOPT_PROXYUSERPWD, 'user: password');
curl_setopt ($ request, CURLOPT_PORT, 5725);
curl_setopt ($ request, CURLOPT_HTTPHEADER, array (
'Authorization: Token qiwnnqncnqiomcoiemcoq',
"Content-Type: application / json",
"Accept: application / json",
"Accept-Language: it-it",
"Accept-Encoding: gzip, deflate, br",
"Origin: https://www.webisite-request.com/",
));
curl_setopt ($ request, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ request, CURLOPT_HEADER, true);
$response = curl_exec ($ request);
curl_close ($ request);
我正在使用webshare.io,但我不明白的问题在哪里
这样设置代理端口:
curl_setopt ($ request, CURLOPT_PROXY, '102.xxx.xx.xx:5725');
不使用CURLOPT_PORT