summary refs log tree commit diff
path: root/gateway/src
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-13 20:54:03 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-13 20:54:03 +0200
commita772b32f6b1cb828195e6a6e0869dcfded3aa9fc (patch)
tree412ea456939a6fed0b27120bcaf0236e746f2578 /gateway/src
parent:bug: fix api middleware (diff)
downloadserver-a772b32f6b1cb828195e6a6e0869dcfded3aa9fc.tar.xz
:bug: fix bundle gateway listen
Diffstat (limited to '')
-rw-r--r--gateway/src/Server.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/gateway/src/Server.ts b/gateway/src/Server.ts
index 482545f1..c2bc9c47 100644
--- a/gateway/src/Server.ts
+++ b/gateway/src/Server.ts
@@ -22,9 +22,15 @@ export class Server {
 				res.writeHead(200).end("Online");
 			});
 
+		this.server.on("upgrade", (request, socket, head) => {
+			this.ws.handleUpgrade(request, socket, head, (socket) => {
+				this.ws.emit("connection", socket, request);
+			});
+		});
+
 		this.ws = new WebSocketServer({
 			maxPayload: 4096,
-			server: this.server,
+			noServer: true,
 		});
 		this.ws.on("connection", Connection);
 		this.ws.on("error", console.error);