From 0445f0e7ba2940a74c903880e131db0fe1790b09 Mon Sep 17 00:00:00 2001 From: LoveEevee Date: Wed, 12 Sep 2018 20:39:29 +0300 Subject: [PATCH] Add port to websocket --- public/src/js/p2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/js/p2.js b/public/src/js/p2.js index b1be188..137c595 100644 --- a/public/src/js/p2.js +++ b/public/src/js/p2.js @@ -21,7 +21,7 @@ class P2Connection{ open(){ this.closed = false var wsProtocol = location.protocol == "https:" ? "wss:" : "ws:" - this.socket = new WebSocket(wsProtocol + "//" + window.location.hostname + "/p2") + this.socket = new WebSocket(wsProtocol + "//" + location.host + "/p2") var events = ["open", "close", "message"] events.forEach(eventName => { this.socket.addEventListener(eventName, event => {