H.HTTP.Router (H v0.3.0)

Copy Markdown View Source

Plug.Router for the local H HTTP/JSON and SSE daemon.

Runtime options:

  • :port - expected HTTP port for Host / Origin checks (defaults to conn.port when omitted or 0)
  • :auth_server - H.Auth GenServer name/pid (default H.Auth)
  • :auth_table - H.Auth ETS table name (default :h_auth)
  • :daemon - transport-agnostic backend module (default H.Daemon)
  • :daemon_opts - keyword list forwarded to daemon calls (default [])
  • :allow_localhost - allow localhost:<port> in Host/Origin checks (default false)
  • :unix_socket - treat connections as Unix domain socket requests (default false; also auto-detected via conn.remote_ip)
  • :sse_keepalive_ms - SSE : keepalive interval in ms (default 15_000)
  • :sse_max_queue_len - max mailbox messages before SSE snapshot reset (default 128)
  • :sse_max_queue_bytes - max process memory bytes before SSE snapshot reset (default 2_097_152)

Summary

Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Functions

call(conn, opts)

Callback implementation for Plug.call/2.

init(opts)

Callback implementation for Plug.init/1.