feat: signal server tag

This commit is contained in:
2026-06-05 06:16:02 +02:00
parent 6865147e8f
commit bf4e6891d1
69 changed files with 2808 additions and 1269 deletions
@@ -23,6 +23,10 @@ export const PEER_DISCONNECT_GRACE_MS = 10_000;
export const STATE_HEARTBEAT_INTERVAL_MS = 5_000;
/** Interval (ms) for application-level signaling keepalive messages */
export const SIGNALING_KEEPALIVE_INTERVAL_MS = 25_000;
/** How long to wait for a keepalive_ack before treating the socket as dead (ms) */
export const SIGNALING_KEEPALIVE_ACK_TIMEOUT_MS = 10_000;
/** How often to probe the signaling HTTP health endpoint while connected (ms) */
export const SIGNALING_HEALTH_PROBE_INTERVAL_MS = 5_000;
/** Interval (ms) for broadcasting voice presence */
export const VOICE_HEARTBEAT_INTERVAL_MS = 5_000;
@@ -82,6 +86,20 @@ export const SIGNALING_TYPE_USER_JOINED = 'user_joined';
export const SIGNALING_TYPE_USER_LEFT = 'user_left';
export const SIGNALING_TYPE_ACCESS_DENIED = 'access_denied';
export const SIGNALING_TYPE_KEEPALIVE = 'keepalive';
export const SIGNALING_TYPE_KEEPALIVE_ACK = 'keepalive_ack';
/** Signaling payloads that can be dropped quietly while the socket is reconnecting. */
export const TRANSIENT_SIGNALING_OUTBOUND_TYPES = new Set<string>([
SIGNALING_TYPE_ICE_CANDIDATE,
SIGNALING_TYPE_OFFER,
SIGNALING_TYPE_ANSWER,
SIGNALING_TYPE_KEEPALIVE,
'status_update'
]);
export function isTransientSignalingOutboundType(type: string | undefined): boolean {
return typeof type === 'string' && TRANSIENT_SIGNALING_OUTBOUND_TYPES.has(type);
}
export const P2P_TYPE_STATE_REQUEST = 'state-request';
export const P2P_TYPE_VOICE_STATE_REQUEST = 'voice-state-request';