|
|
@@ -15,12 +15,12 @@
|
|
|
console.log("您的浏览器支持WebSocket");
|
|
|
//实现化WebSocket对象,指定要连接的服务器地址与端口,建立连接.
|
|
|
// var socketUrl = "http://localhost:8086/socket/" + $("#uid").val();
|
|
|
- var socketUrl = "http://localhost:8086/websocket/";
|
|
|
+ var socketUrl = "http://localhost:8086/websocket";
|
|
|
//将https与http协议替换为ws协议
|
|
|
socketUrl = socketUrl.replace("https", "ws").replace("http", "ws");
|
|
|
console.log(socketUrl);
|
|
|
if (socket != null) {
|
|
|
- socket.close();8
|
|
|
+ socket.close();
|
|
|
socket = null;
|
|
|
}
|
|
|
socket = new WebSocket(socketUrl);
|