The host (server.js) do the following:
Each worker creates net server on passed listening socket file descriptor and accepts clients' sockets. It gives an unique (for the worker only) ID to the user and tries to detect protocol client wants to use. Special fabricated protocol and websocket draft76 are available for now. Then it tries to make a handshake. If handshake failed client is immediately disconnected. After that a worker sends information about client to the host. It checks whether it can accept the user and gives unique ID (for the whole server) and adds to the pool. Then it waits user to subscribe for a daemon.
Daemon connects to the worker, and sends daemon command. Worker pass that message to the host. Host checks if this daemon is allowed it the context and adds it to the pool.
Anonymous