Parrhesia.Plug (parrhesia v0.12.0)

Copy Markdown

Official Plug interface for mounting Parrhesia HTTP/WebSocket ingress in a host app.

This plug serves the same route surface as the built-in listener endpoint:

  • GET /health by default, or the listener-configured health path
  • GET /ready by default, or the listener-configured ready path
  • GET /relay by default, or the listener-configured relay path
  • POST /management by default, or the listener-configured management path
  • GET /metrics by default, or the listener-configured metrics path

Options

  • :listener - listener configuration used to authorize and serve requests. Supported values:
    • an atom listener id from config :parrhesia, :listeners (for example :public)
    • a listener config map/keyword list (same schema as :listeners entries)

When a host app owns the HTTPS edge, a common pattern is:

config :parrhesia, :listeners, %{}

and mount Parrhesia.Plug with an explicit :listener map.

Summary

Types

listener_option()

@type listener_option() :: atom() | map() | keyword()

option()

@type option() :: {:listener, listener_option()}