From e6360ffbadc58bae2dedfdff01e80374893c8b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B3=A2=E5=B7=B4=E5=B8=8C=E4=BA=9A?= <185846969@qq.com> Date: Thu, 1 Apr 2021 09:35:11 +0800 Subject: [PATCH] update src/main/resources/templates/chatroom.html. --- src/main/resources/templates/chatroom.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/chatroom.html b/src/main/resources/templates/chatroom.html index dcc88ed..f9edc16 100644 --- a/src/main/resources/templates/chatroom.html +++ b/src/main/resources/templates/chatroom.html @@ -95,7 +95,7 @@ Date.prototype.format = function(fmt) { $("#user").html(user); if ('WebSocket' in window) { - websocket = new WebSocket("ws://localhost:8080/webSocket/"+user); + websocket = new WebSocket("ws://"+window.location.host+"/webSocket/"+user); } websocket.onmessage = function(event) { var data=JSON.parse(event.data); -- Gitee