# pusher_server v0.1.2 - Table of Contents

> A self-hosted, Pusher-protocol-compatible WebSocket server (drop-in for Laravel Reverb) built on Cowboy.

## Pages

- [pusher_server](readme.md)

- Guides
  - [Getting started](getting-started.md)
  - [Configuration](configuration.md)
  - [Embedding in your app](embedding.md)
  - [Running several servers](multi-server.md)
  - [Deployment](deployment.md)
  - [Protocol support](protocol-support.md)
  - [Troubleshooting](troubleshooting.md)

- Project
  - [Contributing](contributing.md)
  - [Security policy](security.md)
  - [Changelog](changelog.md)

## Modules

- Public API
  - [PusherServer](PusherServer.md): Embed a Pusher-protocol-compatible websocket server in your own
application's supervision tree

- Configuration
  - [PusherServer.Config](PusherServer.Config.md): Per-instance configuration.

- Backends
  - [PusherServer.Backend](PusherServer.Backend.md): The seam between "one node" and "many nodes".
  - [PusherServer.Backend.Local](PusherServer.Backend.Local.md): Single-node, in-memory backend. No external dependencies.
  - [PusherServer.Backend.Redis](PusherServer.Backend.Redis.md): Redis backend: lets several `pusher_server` nodes behave as one.

- Internals
  - [PusherServer.Application](PusherServer.Application.md): OTP application callback — only relevant when this project is compiled
and released as its own standalone deployment (the Docker image). When
`pusher_server` is instead pulled in as a hex dependency of another
app, this starts an empty supervisor and does nothing: the host app is
expected to add `{PusherServer, opts}` to its own supervision tree
explicitly (see PusherServer's moduledoc).
  - [PusherServer.Auth](PusherServer.Auth.md): Implements the two signature schemes Pusher/Reverb use
  - [PusherServer.Backend.Redis.Janitor](PusherServer.Backend.Redis.Janitor.md): Keeps the shared Redis state honest when a node dies without cleaning up.
  - [PusherServer.Backend.Redis.Subscriber](PusherServer.Backend.Redis.Subscriber.md): Receives other nodes' broadcasts from Redis pub/sub and delivers them
to the sockets connected to *this* node.
  - [PusherServer.Cluster](PusherServer.Cluster.md): The one place the websocket handler and HTTP router go through for
anything that may need to reach *other* nodes: broadcasting, presence,
and channel occupancy.
  - [PusherServer.HttpRouter](PusherServer.HttpRouter.md): Plug router for the Pusher REST API
  - [PusherServer.Metrics](PusherServer.Metrics.md): Counters and a Prometheus-format exporter for one instance.
  - [PusherServer.Naming](PusherServer.Naming.md): Derives unique process/registry names from an instance `name`, so
multiple named instances (e.g. two different app_ids on two different
ports, both embedded in the same host app) never collide.

  - [PusherServer.Presence](PusherServer.Presence.md): Tracks presence-channel membership for one instance. Keyed internally
by socket_id so a user with multiple tabs/connections works correctly:
`member_added` only fires for a user_id's first connection,
`member_removed` only fires when their last connection drops.
  - [PusherServer.Webhook](PusherServer.Webhook.md): Fires webhooks in the same shape Pusher/Reverb send them, so your
Laravel app can register a webhook route the way it would for real
Pusher
  - [PusherServer.WsHandler](PusherServer.WsHandler.md): Implements the client-facing side of the Pusher protocol over a raw
cowboy websocket (not Phoenix Channels — a different wire format).

