zhouaini528 / bybit-php

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

Bybit Websocket connect #14

Closed Prooksius closed 1 year ago

Prooksius commented 1 year ago

Hello, friend.

Here is some attempt to help you in order to make bybit websocket connection (public & private).

Please use and improve as you like.

Prooksius commented 1 year ago

Thank you for your binance library, I successfully use it. Here is sort of my contribution to you great work. May help to start and improve in future.

Prooksius commented 1 year ago

Here is config example:

$bybit->config([
  //Do you want to enable local logging,default false
  //'log' => true,
  //Or set the log name,
  //'log' => ['filename' => spot],

  //Daemons address and port
  'global' => '127.0.0.1:2210',

  //Heartbeat time,default 20 seconds
  //'ping_time' => 20,

  //Channel subscription monitoring time,2 seconds
  //'listen_time' => 2,

  //Channel data update time,0.1 seconds
  // 'data_time' => 0.1,

  //Number of messages WS queue shuold hold, default 100
  //'queue_count' => 100,

  //baseurl, type - public|private
  //'baseurl'=>'ws://stream.bybit.com/spot/{type}/v3',//spot default
  'baseurl'=>'ws://stream.bytick.com/realtime_{type}', // USDT (Linear) Perpetual
  //'baseurl'=>'ws://stream.bybit.com/realtime', // USDT (Inverse) Perpetual
]);
zhouaini528 commented 1 year ago

Thank you for your contribution.