v1.1.1: fix(#10) ping syntax for websockets
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bitget-api",
|
"name": "bitget-api",
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"description": "Node.js connector for Bitget REST APIs and WebSockets, with TypeScript & end-to-end tests.",
|
"description": "Node.js connector for Bitget REST APIs and WebSockets, with TypeScript & end-to-end tests.",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ export class WebsocketClient extends EventEmitter {
|
|||||||
this.clearPongTimer(wsKey);
|
this.clearPongTimer(wsKey);
|
||||||
|
|
||||||
this.logger.silly('Sending ping', { ...LOGGER_CATEGORY, wsKey });
|
this.logger.silly('Sending ping', { ...LOGGER_CATEGORY, wsKey });
|
||||||
this.tryWsSend(wsKey, JSON.stringify({ op: 'ping' }));
|
this.tryWsSend(wsKey, 'ping');
|
||||||
|
|
||||||
this.wsStore.get(wsKey, true).activePongTimer = setTimeout(() => {
|
this.wsStore.get(wsKey, true).activePongTimer = setTimeout(() => {
|
||||||
this.logger.info('Pong timeout - closing socket to reconnect', {
|
this.logger.info('Pong timeout - closing socket to reconnect', {
|
||||||
|
|||||||
Reference in New Issue
Block a user