p3x-redis-ui-server
Version:
🏍️ P3X Redis UI server — Socket.IO backend for the dual Angular + React frontend with AI queries, 54 languages, and auto data decompression
2 lines (1 loc) • 441 B
JavaScript
import{Server as t}from"socket.io";import{resolveConfiguredHttpAuth as e,verifyAuthToken as o}from"../../lib/http-auth.mjs";import r from"./socket.mjs";export default function(){this.boot=async i=>{const s=i.httpService,n=new t(s.server,{secure:!0,path:"/socket.io",maxHttpBufferSize:268435456});n.use((t,r)=>{if(!e().enabled)return void r();const i=t.handshake.auth?.token;i&&o(i)?r():r(new Error("auth_required"))}),r(n),this.socketio=n}}