Commit 75c35f1a by ken

try

parent 27408238
const stream = 'wss://api.zb.com:9999/websocket'; const stream = 'wss://api.zb.cn/websocket';
// const stream = "wss://kline.zb.cn/websocket"; // const stream = "wss://kline.zb.cn/websocket";
const WebSocket = require('ws'); const WebSocket = require('ws');
const request = require('request'); const request = require('request');
...@@ -200,7 +200,7 @@ function depthByRest(symbol,callback) { ...@@ -200,7 +200,7 @@ function depthByRest(symbol,callback) {
// const urls = [`http://api.zb.cn/data/v1/depth?market=${symbol}&size=5`, `http://api.zb.com/data/v1/depth?market=${symbol}&size=5`]; // const urls = [`http://api.zb.cn/data/v1/depth?market=${symbol}&size=5`, `http://api.zb.com/data/v1/depth?market=${symbol}&size=5`];
// detphRestSentAmount += 1; // detphRestSentAmount += 1;
// const index = detphRestSentAmount % 2; // const index = detphRestSentAmount % 2;
const url = `http://api.zb.com/data/v1/depth?market=${symbol}&size=10`; const url = `http://api.zb.cn/data/v1/depth?market=${symbol}&size=10`;
const sendTime = Date.now(); const sendTime = Date.now();
_request("GET", url, (err, data) => { _request("GET", url, (err, data) => {
const lastDepthRestSendTime = lastDepthRestSendTimeMap[symbol] || 0; const lastDepthRestSendTime = lastDepthRestSendTimeMap[symbol] || 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment