@meshagent/meshagent-node
v0.44.13
Published
Node.js helpers for MeshAgent TypeScript applications.
Downloads
2,676
Readme
MeshAgent Node TypeScript
Node.js helpers for MeshAgent TypeScript applications.
Room websocket proxy
attachRoomWebSocketProxy attaches a raw websocket upgrade tunnel to a Node HTTP server. By default it listens on /.well-known/meshagent/room/connect, reads the room websocket target from MESHAGENT_ROOM_WEBSOCKET_URL or derives it from MESHAGENT_API_URL/MESHAGENT_PROFILE_API_URL and MESHAGENT_ROOM, and forwards the upgrade with Authorization: Bearer $MESHAGENT_TOKEN.
import { createServer } from "node:http";
import { attachRoomWebSocketProxy } from "@meshagent/meshagent-node";
const server = createServer(app);
attachRoomWebSocketProxy(server);