Documentation
¶
Overview ¶
SSE provides a Server-Sent Events fallback for environments where both WebTransport (UDP) and WebSocket (TCP upgrade) are blocked.
SSE is unidirectional (server → client only). For client → server, pair with regular HTTP POST requests.
This is the most degraded fallback mode — use only when nothing else works.
Package fallback provides a transparent WebSocket fallback for the wt framework.
When a client can't use WebTransport (Safari, corporate firewalls blocking UDP, old browsers), the fallback layer serves the same handlers over WebSocket. Stream multiplexing is simulated over the single WebSocket connection using a simple framing protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SSEClient ¶
type SSEClient struct {
// contains filtered or unexported fields
}
SSEClient represents a connected SSE client.
type SSEHub ¶
type SSEHub struct {
// contains filtered or unexported fields
}
SSEHub manages SSE client connections.
type WSConn ¶
type WSConn struct {
// contains filtered or unexported fields
}
WSConn wraps a WebSocket connection and provides stream multiplexing.
func (*WSConn) AcceptStream ¶
AcceptStream waits for the next incoming stream from the client.
func (*WSConn) OpenStream ¶
OpenStream creates a new outbound stream.
func (*WSConn) ReceiveDatagram ¶
ReceiveDatagram receives a datagram-like message.
func (*WSConn) SendDatagram ¶
SendDatagram sends a datagram-like message (simulated over WebSocket).