2016-12-22 15:19:38 +01:00
|
|
|
= cowboy_http2(3)
|
|
|
|
|
|
|
|
== Name
|
|
|
|
|
|
|
|
cowboy_http2 - HTTP/2
|
|
|
|
|
|
|
|
== Description
|
|
|
|
|
|
|
|
The module `cowboy_http2` implements HTTP/2
|
|
|
|
as a Ranch protocol.
|
|
|
|
|
2016-12-22 18:13:25 +01:00
|
|
|
== Options
|
2016-12-22 15:19:38 +01:00
|
|
|
|
2017-05-05 13:48:25 +02:00
|
|
|
// @todo Might be worth moving cowboy_clear/tls/stream_h options
|
|
|
|
// to their respective manual, when they are added.
|
|
|
|
|
2016-12-22 15:19:38 +01:00
|
|
|
[source,erlang]
|
|
|
|
----
|
|
|
|
opts() :: #{
|
2017-05-05 13:48:25 +02:00
|
|
|
connection_type => worker | supervisor,
|
|
|
|
env => cowboy_middleware:env(),
|
|
|
|
inactivity_timeout => timeout(),
|
|
|
|
middlewares => [module()],
|
|
|
|
preface_timeout => timeout(),
|
|
|
|
shutdown_timeout => timeout(),
|
|
|
|
stream_handlers => [module()]
|
2016-12-22 15:19:38 +01:00
|
|
|
}
|
|
|
|
----
|
|
|
|
|
|
|
|
Configuration for the HTTP/2 protocol.
|
|
|
|
|
|
|
|
This configuration is passed to Cowboy when starting listeners
|
2017-06-07 15:15:54 +02:00
|
|
|
using `cowboy:start_clear/3` or `cowboy:start_tls/3` functions.
|
2016-12-22 15:19:38 +01:00
|
|
|
|
|
|
|
It can be updated without restarting listeners using the
|
|
|
|
Ranch functions `ranch:get_protocol_options/1` and
|
|
|
|
`ranch:set_protocol_options/2`.
|
|
|
|
|
2016-12-22 18:13:25 +01:00
|
|
|
The default value is given next to the option name:
|
2016-12-22 15:19:38 +01:00
|
|
|
|
2017-05-05 13:48:25 +02:00
|
|
|
connection_type (supervisor)::
|
|
|
|
Whether the connection process also acts as a supervisor.
|
|
|
|
|
2016-12-22 15:19:38 +01:00
|
|
|
env (#{})::
|
|
|
|
Middleware environment.
|
|
|
|
|
2017-05-05 13:48:25 +02:00
|
|
|
inactivity_timeout (300000)::
|
|
|
|
Time in ms with nothing received at all before Cowboy closes the connection.
|
|
|
|
|
2016-12-22 15:19:38 +01:00
|
|
|
middlewares ([cowboy_router, cowboy_handler])::
|
|
|
|
Middlewares to run for every request.
|
|
|
|
|
|
|
|
preface_timeout (5000)::
|
|
|
|
Time in ms Cowboy is willing to wait for the connection preface.
|
|
|
|
|
2017-05-05 13:48:25 +02:00
|
|
|
shutdown_timeout (5000)::
|
|
|
|
Time in ms Cowboy will wait for child processes to shut down before killing them.
|
|
|
|
|
|
|
|
stream_handlers ([cowboy_stream_h])::
|
|
|
|
Ordered list of stream handlers that will handle all stream events.
|
|
|
|
|
2016-12-22 15:19:38 +01:00
|
|
|
== Changelog
|
|
|
|
|
|
|
|
* *2.0*: Protocol introduced.
|
|
|
|
|
|
|
|
== See also
|
|
|
|
|
|
|
|
link:man:cowboy(7)[cowboy(7)],
|
|
|
|
link:man:cowboy_http(3)[cowboy_http(3)],
|
|
|
|
link:man:cowboy_websocket(3)[cowboy_websocket(3)]
|