Set proxy in Guzzle

后端 未结 6 479
广开言路
广开言路 2021-01-11 13:06

I have a problem with set proxy in guzzle that a blank page was shown while with curl everything works perfect. The code that I used in guzzle and curl came below. What is w

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-11 13:41

    Had the same problem right now , and all i needed to do was use curl array keys as constants instead of strings ..

    $response = $client->send($request, [
                  'timeout'  => 30,
                  'curl'  => [
                      CURLOPT_PROXY => '*.*.*.*',
                      CURLOPT_PROXYPORT => *,
                      CURLOPT_PROXYUSERPWD => '*:*',
                 ],
             ]);
    

    See CURL options Keys , they are not strings anymore.

提交回复
热议问题