Documentation
¶
Overview ¶
Package sse provides an SSE transport for tether. Use it when the deployment environment does not support WebSocket (e.g. certain PaaS providers, corporate proxies, or HTTP/2-only setups).
The transport is unidirectional - server→client only. Updates flow as Server-Sent Events over a long-lived HTTP GET (EventSource on the client side). Client events arrive as individual HTTP POST requests and are routed directly to the session's command channel by the tether handler.
Wire up by passing sse.Upgrade() as the Fallback (or Upgrade) field in tether.StatefulConfig and setting Mode to [mode.ServerSentEvents] or [mode.Both].
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Upgrade ¶
Upgrade returns an upgrade function for use in tether.StatefulConfig.Fallback (or Upgrade when Mode is mode.ServerSentEvents). When the tether handler receives a GET with Accept: text/event-stream, it calls this function to establish the SSE stream. The stream stays open for the lifetime of the session; server updates are written as SSE "data" lines.
Types ¶
This section is empty.