David Prince
fix: add all missing local module stubs (remote_mcp_registry, mcp_auth, mcp_transport, etc)
cce8120
Raw
History Blame Contribute Delete
553 Bytes
import { io } from "socket.io-client";
const SOCKET_URL =
process.env.NEXT_PUBLIC_WS_URL ||
"http://127.0.0.1:8000";
let socket = null;
export function connectSocket(token = null) {
if (socket) return socket;
socket = io(SOCKET_URL, {
transports: ["websocket"],
autoConnect: true,
auth: token ? { token } : {}
});
return socket;
}
export function disconnectSocket() {
if (socket) {
socket.disconnect();
socket = null;
}
}
export function getSocket() {
return socket;
}