Commit cbb58701 by ken

depth

parent 7022c15a
const stream = 'wss://api.zb.com:9999/websocket'; const stream = 'wss://api.zb.cn:9999/websocket';
// const stream = "wss://kline.zb.com:2443/websocket"; // const stream = "wss://kline.zb.com:2443/websocket";
const WebSocket = require('ws'); const WebSocket = require('ws');
const request = require('request'); const request = require('request');
...@@ -195,7 +195,7 @@ function _handleDepthData(symbol, data, source) { ...@@ -195,7 +195,7 @@ function _handleDepthData(symbol, data, source) {
const lastDepthRestSendTimeMap = {}; const lastDepthRestSendTimeMap = {};
function depthByRest(symbol,callback) { function depthByRest(symbol,callback) {
const url = `http://api.zb.com/data/v1/depth?market=${symbol}&size=5`; const url = `http://api.zb.cn/data/v1/depth?market=${symbol}&size=5`;
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