zhouaini528 / bybit-php

Bybit API Like the official document interface, Support for arbitrary extension.
MIT License
24 stars 12 forks source link

Proxy with authorization ip:port@login:pass #9

Closed artstudia86 closed 1 year ago

artstudia86 commented 2 years ago

How to connect private proxies like ip:port@login:pass ?

Prooksius commented 1 year ago
$login = '.....';
$password = '.......';
$IP_address = 'XX.XX.XX.XX';
$port = 'XXXX';

$bybit = new BybitLinearRequest();
$bybit->setOptions([
  'proxy' => [
     'http'  => 'http://' . $login . ':' . $password . '@' . $IP_address . ':' . $port,
     'https' => 'http://' . $login . ':' . $password . '@' . $IP_address . ':' . $port,
  ],
]);

$result = $bybit->publics()->getTickers();