Topical.Adapters.Cowboy.WebsocketHandler (topical v0.2.2)
A WebSocket handler adapter for a Cowboy web server.
options
Options
registry
- The name of the Topical registry. Required.init
- A function called before upgrading the connection, which is passed the request. The function must return{:ok, context}
for the connection to be accepted. Thiscontext
is then passed to topics.
example
Example
:cowboy_router.compile([
{:_,
[
# ...
{"/socket", WebsocketHandler, registry: MyApp.Topical}
]}
])