We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70fcfe0 commit 957a4beCopy full SHA for 957a4be
csp/js/app.js
@@ -0,0 +1,15 @@
1
+const host = `127.0.0.1:57772`;
2
+var str=`ws://${host}/chat/WebCourse.ChatWebSocket.cls`;
3
+let ws = new WebSocket(str);
4
+ws.addEventListener(`open`,()=>{
5
+ console.log(`we are connected to the chat`);
6
+});
7
+ws.addEventListener(`error`,(err)=>{
8
+ console.error(`connection error:`,err);
9
10
+ws.addEventListener(`close`,(e)=>{
11
+ console.log(`we are disconnected from the chat.`+e);
12
13
+ws.addEventListener(`message`,({data})=>{
14
+ console.log(`Data received from the server`,JSON.stringify(data));
15
0 commit comments