PHP程序CURL终端走代理的方法】
1、需要加一段配置,curl_setopt($ch,CURL_PROXY,'127.0.0.1:10800')
2、注意走的是HTTP代理,所以V2Ray里面的inbounds需要加一段http代理,而不能用socks
curl_setopt($ch, CURLOPT_PROXY, '128.0.0.3:8080');
或
curl_setopt($ch, CURLOPT_PROXY, '128.0.0.3');
curl_setopt($ch, CURLOPT_PROXYPORT, '8080');
例子:
$ch = curl_init($url);
$url = "http://beamtic.com/Examples/http-post.php";
curl_setopt($ch, CURLOPT_PROXY, '128.0.0.3');
curl_setopt($ch, CURLOPT_PROXYPORT, '8080');
// Perform the request, and save content to $result
$result = curl_exec($ch);
echo $result;
详细的介绍:https://beamtic.com/using-proxies-with-curl