WebSocket proxy handler implementing the WebSock behavior. Maintains bidirectional connection between client and backend.
Summary
Functions
Handles control frames from the client.
Handles incoming frames from the client and forwards them to the backend.
Handles messages from the backend connection.
Initializes the WebSocket proxy connection.
Cleanup when connection terminates.
Types
@type t() :: %ReverseIt.WebSocketProxy{ backend_upgrade_timer: reference() | nil, client: map(), config: ReverseIt.Config.t(), conn: Mint.HTTP.t(), pending_bytes: non_neg_integer(), pending_frames: [Mint.WebSocket.frame()], request_ref: Mint.Types.request_ref(), websocket: Mint.WebSocket.t() }
Functions
Handles control frames from the client.
Handles incoming frames from the client and forwards them to the backend.
Handles messages from the backend connection.
Initializes the WebSocket proxy connection.
The state contains:
- config: Backend configuration
- client_headers: Original client headers for forwarding
Cleanup when connection terminates.