Add port to websocket

This commit is contained in:
LoveEevee 2018-09-12 20:39:29 +03:00
parent 8e99da6aa2
commit 0445f0e7ba

View File

@ -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 => {