HTTP Fallback Lane (SSE + POST)

For environments where WebSocket upgrades are blocked (typically corporate firewalls + restrictive HTTP proxies) but plain HTTPS GET/POST work. The SDK exposes a SseTransport primitive you can drop in alongside the WebSocket client. Available since SDK 0.19.0.

Wire

  • GET /v1/transport/stream?token=<jwt> — long-lived text/event-stream response. Server pushes base64-encoded protobuf frames as data: lines on the envelope event. JWT in the query parameter (the spec-allowed workaround because EventSource can't send custom headers). 25s keep-alive comments defeat proxy idle timeouts.
  • POST /v1/transport/send with Content-Type: application/octet-stream and the raw protobuf Envelope as the body. Authorization: Bearer <jwt> header. Returns 202 Accepted with the messageId; rejects mismatched appId/fromUserId with 403.

SDK usage (JavaScript)


import { SseTransport } from '@droponair/sdk-js';

const sse = new SseTransport({
  httpUrl: 'https://sdk.droponair.com',
  getJwt: async () => jwt,
});
sse.onFrame((bytes) => { /* protobuf decode */ });
await sse.connect();
await sse.sendEnvelope(envelopeBytes);

Same pattern on Android (com.droponair.sdk.transport.SseTransport using OkHttp's okhttp-sse module) and iOS (DOASseTransport using URLSession streaming).

Scope

v1 covers 1:1 Envelope delivery (messages, multi-device fan-out, sender self-sync). Group/room call signaling stays on WebSocket; calls inherently need WebRTC anyway, and customers in restrictive networks typically need messaging more urgently than calls.

Verify support via GET /api/info: transports includes "sse" and features includes "transport_sse".