Add WebSocket test client and server code.

This commit is contained in:
2025-06-17 07:15:46 +00:00
parent 061ecf5d1f
commit baf04b48f9
8 changed files with 57 additions and 130 deletions
+14
View File
@@ -0,0 +1,14 @@
const http = require('http')
const WebSocket = require('ws')
const server = http.createServer()
const wss = new WebSocket.Server({ server })
wss.on('connection', ws => {
ws.on('message', msg => {
ws.send(`echo ${msg}`)
console.log(`Received: ${msg}`)
})
})
server.listen(8078)