Thời gian thực
Bề mặt Socket.IO phát các thay đổi cờ, tin nhắn và lần chạy quy trình tới các máy khách đã kết nối. Kết nối chưa xác thực bị ngắt ngay lập tức.
At a glance
- Host
https://eu.ws.prodantix.com- Transport
- Socket.IO
- Auth
- Access token on the handshake
- Rooms
- Tenant room automatically, project and report rooms via
subscribe
Plain Text
https://eu.ws.prodantix.comAuthenticating the handshake
The token is read from handshake.auth.token, handshake.auth.authorization, or the Authorization header, whichever is present.
Rooms
A connection joins its tenant room automatically. Project rooms are opt-in through subscribe, and every join is authorized server-side against the projects the caller’s tenant owns. A report room is joined the same way with a reportId in place of the projectId; it carries that report’s comment changes, and the report must sit in a project the tenant owns.
Events
| Direction | Event | Payload |
|---|---|---|
| server → client | ready | { tenantId } |
| client → server | subscribe | { projectId } or { reportId } |
| server → client | subscribed | { projectId } or { reportId } |
| client → server | unsubscribe | { projectId } or { reportId } |
| server → client | unsubscribed | { projectId } or { reportId } |
| server → client | error | { message } |
Connecting
TypeScript
import { io } from 'socket.io-client';
const socket = io('https://eu.ws.prodantix.com', {
auth: { token: accessToken },
});
socket.on('ready', ({ tenantId }) => {
socket.emit('subscribe', { projectId });
});
socket.on('flagChange', payload => console.log(payload));