zhouaini528 / binance-php

Binance API Like the official document interface, Support for arbitrary extension.
MIT License
107 stars 43 forks source link

outgoing IP #47

Open blackcatt opened 1 year ago

blackcatt commented 1 year ago

Hi, thanks for good tool! How to use binance api with different IP on my server? (without proxy) I have multiple IP from my ISP, attached to debian11 and know that curl can do this via the CURLOPT_INTERFACE directive. But how to use it in the setOptions func?

zhouaini528 commented 1 year ago
$binance->setOptions([
   'curl'=>[
       CURLOPT_PROXY => '127.0.0.1',
       CURLOPT_PROXYPORT => '10808',
       CURLOPT_PROXYTYPE => CURLPROXY_SOCKS5,
   ]
]);

The way I use it is to set up a proxy server locally, and the proxy server can distribute your multiple IPs. PHP has completed the use of multiple IPs through CURLPROXY_SOCKS5.