# `Musubi.Transport.Socket`
[🔗](https://github.com/fahchen/musubi/blob/v0.3.0/lib/musubi/transport/socket.ex#L1)

Phoenix socket adapter generated by `use Musubi.Socket`.

Application modules should prefer `use Musubi.Socket`; this module owns the
Phoenix-specific expansion and connect context plumbing.

# `__using__`
*macro* 

```elixir
@spec __using__(keyword()) :: Macro.t()
```

Declares the Phoenix socket adapter for a Musubi socket.

## Examples

    defmodule MyAppWeb.MusubiSocket do
      use Musubi.Socket, roots: [MyApp.Stores.DashboardStore]
    end

# `build_connect_socket`

```elixir
@spec build_connect_socket(map(), map()) :: Musubi.Socket.t()
```

Builds the Musubi socket context for a Phoenix connect callback.

## Examples

    iex> socket = Musubi.Transport.Socket.build_connect_socket(%{"token" => "t"}, %{session: %{"user_id" => "u1"}})
    iex> Musubi.Socket.session(socket)
    %{"user_id" => "u1"}

---

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