且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 PHP 中设置 HTTP 代理设置?

更新时间:2023-02-22 22:38:50

我认为你可能需要使用 cURL 扩展来进行传输并将相关的代理选项传递给 cURL.

I think you may need to use the cURL extension to carry out the transfer and pass the relevant proxy options to cURL.

cURL 扩展

curl_setopt 函数将选项传递给 cURL 会话

curl_setopt function to pass options to a cURL session

您需要的代理选项是:CURL_PROXY 和 CURL_PROXYPORT.

The proxy options you need are: CURL_PROXY and CURL_PROXYPORT.