LocalLiveView.Socket (LocalLiveView v0.1.0)

Copy Markdown View Source

The Phoenix.Socket local live views connect to.

Mount it in your endpoint:

socket "/llv_socket", LocalLiveView.Socket,
  websocket: [connect_info: [session: @session_options]]

The socket is only needed by views that sync assigns to a mirror; a purely local view never connects. mix llv.install adds the entry above automatically.

Connections are rejected unless the client sends a CSRF token matching the one in the session, so connect_info must carry the session.