@hazejs/socket.io
v1.0.0
Published
Socket.IO server integration for hazejs (namespaces, guard auth, Redis adapter, Node and Bun)
Maintainers
Readme
@hazejs/socket.io
Socket.IO server integration for hazejs: namespaces from app/socket/*.ts, guard-based handshake auth, Redis adapter, Node and Bun.
Install
pnpm add @hazejs/socket.io socket.ioUsage
// app/socket/chat.ts
export default defineNamespace({
middleware: [
authenticate()
],
connection(socket, io) {
socket.on('chat:send', text => io.of('/chat').emit('chat:message', text))
},
})Part of hazejs — see the main README for documentation.
