Quick Start & Best Practices
Get connected to the RMS-Socket service quickly and learn recommended practices for production environments.
Quick Start
Prerequisites
Minimal Connection Example
const io = require("socket.io-client");
const socket = io("wss://rms.lsports.cloud", {
path: "/rms-socket/socket.io",
transports: ["websocket", "polling"],
extraHeaders: {
Authorization: "Bearer YOUR_ACCESS_TOKEN",
customerid: "YOUR_CUSTOMER_ID",
},
});
socket.on("connect", () => {
console.log("Connected!");
socket.emit("join", {}, (response) => {
console.log("Joined room:", response.room);
});
});
socket.on("RESERVE_BET_ACCEPT", (data) => {
console.log("Bet accepted:", data);
});
socket.on("connect_error", (error) => {
console.error("Connection failed:", error.message);
});Connection Lifecycle
1. Connect
2. Join Room
3. Receive Messages
4. Handle Disconnection
Best Practices
Security
Recommended Configuration
Token Refresh Before Expiration
Connection Health Monitoring
Related
Last updated
Was this helpful?