Replies: 1 comment
-
@csidi90, thanks for submitting an issue!
Subscriptions should not a problem. Socket connections will be a problem. Socket connections are initiated via an HTTP request for which you'll be subject to the Binance's standard REST request throttling limits.
So for each market you're instantiating a new client? Each instance of the client, |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am using this wonderful module for my app and I am running into unfixable problems for me. I am subscribing to the candle streams for every USDT pair on Binance for the 5m, 30m, 1h, 4h and 1d timeframes. That quickly adds up to several thousand websocket connections which from my understanding of the binance docs is not a problem. Every combination of a Ticker + Timeframe get passed in a new ccxws.binance() instance and sets the candlePeriod.
I get opening handshake timeouts pretty quickly both locally and in production mode on heroku app and I cant seem to find out why.
Opening handshake has timed out at ClientRequest.req.on (C:\dev\cryptoalerts\server\node_modules\ws\lib\websocket.js:570:7) at ClientRequest.emit (events.js:198:13) at TLSSocket.emitRequestTimeout (_http_client.js:662:40) at Object.onceWrapper (events.js:286:20) at TLSSocket.emit (events.js:198:13) at TLSSocket.Socket._onTimeout (net.js:442:8) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10)
` try {
//this.ohlcv = await this.rest_api.fetchOHLCV(this.market.symbol, this.interval, undefined, 250)
this.ws_api.candlePeriod = "_" + this.interval;
this.ws_api.subscribeCandles(this.market);
this.ws_api.subscribeTicker(this.market)
this.ws_api.on("error", err => console.error(this.market.id, err));
this.ws_api.on("candle", candle =>{
//this.checkCandle(candle);
})
this.ws_api.on("ticker", ticker =>{
this.ticker = ticker;
Beta Was this translation helpful? Give feedback.
All reactions