first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
const { WebSocketServer } = require ("ws");
const wss = new WebSocketServer({ port: 8080 });
wss.on('connection', function connection(ws) {
console.log("客户连接建立成功")
ws.on('message', function message(data) {
console.log("收到客户端发送消息");
console.log(data.toString());
ws.send('服务器给客户端的消息');
});
});