# `A2UI.Socket`
[🔗](https://github.com/23min/ex_a2ui/blob/main/lib/a2ui/socket.ex#L1)

WebSock handler implementing the A2UI message flow.

Bridges WebSocket connections to an `A2UI.SurfaceProvider` implementation.
On connection, calls the provider's `init/1` and `surface/1` to send the
initial UI. On incoming `action` messages, calls `handle_action/2`.

When a Registry is provided, the socket process registers itself on connect,
enabling broadcast dispatch for push updates via `A2UI.Server.push_data/3`
and `A2UI.Server.push_surface/2`.

Arbitrary messages sent to the socket process are delegated to the provider's
`handle_info/2` callback (if implemented).

This module is not used directly by applications. It is configured
internally by `A2UI.Endpoint`.

# `t`

```elixir
@type t() :: %A2UI.Socket{
  provider: module(),
  provider_state: term(),
  registry: atom() | nil,
  surface_id: String.t() | nil
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
