From e2854ca9b12e612904cdbdacf7c92e1eb5e01e28 Mon Sep 17 00:00:00 2001 From: Sergii Bliznichenko Date: Mon, 3 Oct 2022 14:02:07 +0300 Subject: [PATCH] add peerWs emit --- dist/src/instance.js | 1 + src/instance.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/dist/src/instance.js b/dist/src/instance.js index 0ee2bf9..073e14b 100644 --- a/dist/src/instance.js +++ b/dist/src/instance.js @@ -33,6 +33,7 @@ const createInstance = ({ app, server, options }) => { config: customConfig }); app.set('peerWs', wss); + app.emit('peerWs', wss); wss.on("connection", (client) => { const messageQueue = realm.getMessageQueueById(client.getId()); if (messageQueue) { diff --git a/src/instance.ts b/src/instance.ts index 4789205..42a1006 100644 --- a/src/instance.ts +++ b/src/instance.ts @@ -46,6 +46,7 @@ export const createInstance = ({ app, server, options }: { }); app.set('peerWs', wss); + app.emit('peerWs', wss); wss.on("connection", (client: IClient) => { const messageQueue = realm.getMessageQueueById(client.getId());