You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constwsClient=newWebsocketClient();constpairs=["BTCUSDT","ETHUSDT", ... ];constsession=wsClient.connectToWsUrl("wss://fstream.binance.com/stream");wsClient.on("message",data=>{constmessageJson=JSON.stringify(data,null,2);console.log("raw message received ",messageJson);});wsClient.on("open",data=>{console.log("connection opened open:",data.wsKey,data.ws.target.url);consttopics=pairs.data.map(symbol=>`${symbol.toLowerCase()}@aggTrade`)consttopicChunks=chunkArray(topics,100);topicChunks.forEach((chunk,index)=>{constsubscribeMessage={method: "SUBSCRIBE",params: chunk,id: index+1,};// 구독 메시지 전송session.send(JSON.stringify(subscribeMessage));});});
In this case printed console message to 'Bug? Unhandled ws message event type. Check if appendEventIfMissing needs to parse wsKey.',
The onMessage event I defined does not call with the warning log.
It wasn't designed to be used like this, you may see other issues by using the WS client this way... is this to have multiple websocket topics on one connection?
Problems
In this case printed console message to
'Bug? Unhandled ws message event type. Check if appendEventIfMissing needs to parse wsKey.',
The onMessage event I defined does not call with the warning log.
directly like this https://github.com/tiagosiebler/binance/blob/master/src/util/requestUtils.ts#L269
e field is not populated in wsMsg
https://github.com/tiagosiebler/binance/blob/master/src/websocket-client.ts#L403
The message event is not emitted at line 403 in websocket-client.ts.
So, as a temporary solution I
I solved it this way. Is this the correct action?
So I think, why not add a reserved key like 'directly' to wsKey?
The text was updated successfully, but these errors were encountered: