-
Notifications
You must be signed in to change notification settings - Fork 5
/
huobi_server_spot.php
40 lines (29 loc) · 1007 Bytes
/
huobi_server_spot.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
use \Lin\Huobi\HuobiWebSocket;
require 'vendor/autoload.php';
$Huobi = new HuobiWebSocket();
$Huobi->config([
//Do you want to enable local logging,default false
'log'=>false,
//Or set the log name
//'log' => ['filename' => 'spot'],
//Daemons address and port,default 0.0.0.0:2211
//'global'=>'127.0.0.1:2211',
//Channel subscription monitoring time,2 seconds
//'listen_time'=>2,
//Channel data update time,default 0.5 seconds
//'data_time'=>0.5,
//Set up subscription platform, default 'spot'
'platform' => 'spot', //options value 'spot' 'future' 'swap' 'linear' 'option'
//Or you can set it like this
/*
'platform'=>[
'type'=>'spot',
'market'=>'ws://api.huobi.pro/ws',//Market Data Request and Subscription
'order'=>'ws://api.huobi.pro/ws/v2',//Order Push Subscription
//'market'=>'ws://api-aws.huobi.pro/ws',
//'order'=>'ws://api-aws.huobi.pro/ws/v2',
],
*/
]);
$Huobi->start();