Kiaran Docs
DocsAPI ReferenceWebSocket Telemetry

Persistent WebSocket Connections

Kiaran Engine relies on persistent, encrypted WebSocket tunnels to maintain zero-latency communication between your broadcasting software and our ingest servers. This ensures dropped frames are handled gracefully and bitrates are adjusted dynamically.

DPI & Firewall NoticeBecause Kiaran utilizes custom multiplexed HTTP/2 and WebSocket protocols for telemetry, some aggressive corporate firewalls may flag this traffic. Ensure port 443 is open and unrestricted for *.kiaran.stream.

Initializing the Tunnel

To establish a telemetry connection, your client must initiate an Upgrade request using standard WSS (WebSocket Secure).

client.js
import { KiaranClient } from '@kiaran/engine';

const client = new KiaranClient({
  endpoint: 'wss://telemetry.kiaran.stream/v1/ingest',
  apiKey: process.env.KIARAN_STREAM_KEY,
  encryption: 'aes-256-gcm',
  keepAlive: true,
  pingInterval: 15000 // Sends heartbeat every 15s
});

client.on('connect', () => {
  console.log('Tunnel established securely.');
});

client.connect();

Keep-Alive & Padding

To prevent stateful firewalls from closing idle connections during quiet stream moments (e.g., BRB screens), the Kiaran client automatically injects padding frames and keep-alive packets. This explains the continuous low-bandwidth traffic observable in your network monitor.