Ver código fonte

add peerWs emit

Sergii Bliznichenko 2 anos atrás
pai
commit
e2854ca9b1
2 arquivos alterados com 2 adições e 0 exclusões
  1. 1 0
      dist/src/instance.js
  2. 1 0
      src/instance.ts

+ 1 - 0
dist/src/instance.js

@@ -33,6 +33,7 @@ const createInstance = ({ app, server, options }) => {
         config: customConfig
         config: customConfig
     });
     });
     app.set('peerWs', wss);
     app.set('peerWs', wss);
+    app.emit('peerWs', wss);
     wss.on("connection", (client) => {
     wss.on("connection", (client) => {
         const messageQueue = realm.getMessageQueueById(client.getId());
         const messageQueue = realm.getMessageQueueById(client.getId());
         if (messageQueue) {
         if (messageQueue) {

+ 1 - 0
src/instance.ts

@@ -46,6 +46,7 @@ export const createInstance = ({ app, server, options }: {
   });
   });
 
 
   app.set('peerWs', wss);
   app.set('peerWs', wss);
+  app.emit('peerWs', wss);
 
 
   wss.on("connection", (client: IClient) => {
   wss.on("connection", (client: IClient) => {
     const messageQueue = realm.getMessageQueueById(client.getId());
     const messageQueue = realm.getMessageQueueById(client.getId());