# Daemon

> Tag 1: the server announces a daemon connection a program in the container opened, under a connection id it minted; the client answers with everything the daemon says on it, one server frame per channel response, and its channel response finish closes the connection.

Canonical: https://protocol.diverge.network/2.3.0/container-proxy-endpoints/tools-begin/server/daemon/
Specification revision: 2.3.0

The server opens this channel when a program in the container dials the proxy's `/daemon`. It is the server's
half of the connection; the client's half is a
[daemon](/2.3.0/container-proxy-endpoints/tools-begin/client/daemon/) channel the client opens, quoting the same id.

- **The request.** The tag byte `1` followed by a connection id, four
  bytes, that the server minted. [Request](/2.3.0/container-proxy-endpoints/tools-begin/server/daemon/request/)
  states its form.
- **The response.** What the daemon says, as channel responses, each
  one server frame, and the channel response finish, which closes the
  program's socket. [Response](/2.3.0/container-proxy-endpoints/tools-begin/server/daemon/response/) states
  the sequence.
- **The id.** The server chooses the id and keeps it unique among the
  daemon connections it has announced and the client has not
  finished. The proxy does not reuse an id while either half of its connection is open. Daemon connections and database connections
  number independently: an id of one never names the other.
- **Before the other half.** The server reads nothing from the
  program until the client has opened its half. The daemon protocol
  is client-first, so nothing is expected on this channel before then;
  what arrives all the same is held, and written to the program first,
  in order.
- **The account.** The daemon serves the connection for the account
  the container was created under. No credential passes on either
  half.
- **The conduit.** The server writes each channel response to the program's socket as one message, in order, and does not read it; the channel response finish closes the socket.
