From 5c851d222b78c06da54cf5bb918af9ad1ae124a2 Mon Sep 17 00:00:00 2001 From: j-rewerts Date: Fri, 6 Sep 2019 18:03:02 -0600 Subject: [PATCH] Moved websockets to be hosted on same domain. --- app/web.ts | 2 +- www/lib/Hey.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/web.ts b/app/web.ts index 9bea2d9..d791202 100644 --- a/app/web.ts +++ b/app/web.ts @@ -69,7 +69,7 @@ export default ((publicPath: string) => { log.info(`Webserver started on ${port}`); }); - const wss: any = new WebSocket.Server({ port: 8080 }); + const wss: any = new WebSocket.Server({ server, path: '/wss' }); wss.broadcast = (data) => { wss.clients.forEach((client) => { diff --git a/www/lib/Hey.js b/www/lib/Hey.js index 6c0bf73..bb9c8b9 100644 --- a/www/lib/Hey.js +++ b/www/lib/Hey.js @@ -1,6 +1,6 @@ class Hey { constructor() { - this.socket = new WebSocket(`ws://${window.location.hostname}:8080`); + this.socket = new WebSocket(`ws://${window.location.hostname}:${window.location.port}/wss`); this.events = {}; this.open = false;