uws superset who allow you to listen on event like with socket.io
npm install uws-with-on.jsuse is really easy :
(these sample uses the socket.io-with-get.js superset too)
you can use it in the client :
``html`
and this on the server :
``js
const WebSocketServer = require('uws').Server;
const SocketWithOn = require('uws-with-on.js');
const Socket = require('socket.io-with-get');
const wss = new WebSocketServer({ port: 5000 });
wss.on('connection', async function(socket) {
try{
socket = new SocketWithOn(socket);
socket = new Socket(socket);
socket.on('ping',async (data)=>{
return data;
});
let data = await socket.get("name", {}).catch(err=>{throw new Error(err)});
console.log(data);
}catch(e){
console.log(e);
}
});