Browse Source

add peerWs to app

Sergii Kliuchnyk 2 years ago
parent
commit
8695256271
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/instance.ts

+ 3 - 1
src/instance.ts

@@ -41,6 +41,8 @@ export const createInstance = ({ app, server, options }: {
     realm,
     config: customConfig
   });
+  
+  app.peerWs = wss;
 
   wss.on("connection", (client: IClient) => {
     const messageQueue = realm.getMessageQueueById(client.getId());
@@ -72,4 +74,4 @@ export const createInstance = ({ app, server, options }: {
 
   messagesExpire.startMessagesExpiration();
   checkBrokenConnections.start();
-};
+};