diff options
Diffstat (limited to 'doc/src/manual')
-rw-r--r-- | doc/src/manual/cowboy_http.asciidoc | 18 | ||||
-rw-r--r-- | doc/src/manual/cowboy_http2.asciidoc | 18 | ||||
-rw-r--r-- | doc/src/manual/cowboy_req.set_resp_headers.asciidoc | 15 |
3 files changed, 46 insertions, 5 deletions
diff --git a/doc/src/manual/cowboy_http.asciidoc b/doc/src/manual/cowboy_http.asciidoc index 0640aa9..96a5585 100644 --- a/doc/src/manual/cowboy_http.asciidoc +++ b/doc/src/manual/cowboy_http.asciidoc @@ -18,6 +18,7 @@ as a Ranch protocol. ---- opts() :: #{ active_n => pos_integer(), + alpn_default_protocol => http | http2, chunked => boolean(), connection_type => worker | supervisor, dynamic_buffer => false | {pos_integer(), pos_integer()}, @@ -36,6 +37,7 @@ opts() :: #{ max_method_length => non_neg_integer(), max_request_line_length => non_neg_integer(), max_skip_body_length => non_neg_integer(), + protocols => [http | http2], proxy_header => boolean(), request_timeout => timeout(), reset_idle_timeout_on_send => boolean(), @@ -63,6 +65,12 @@ values reduce the number of times Cowboy need to request more packets from the port driver at the expense of potentially higher memory being used. +alpn_default_protocol (http):: + +Default protocol to use when the client connects over TLS +without ALPN. Can be set to `http2` to disable HTTP/1.1 +entirely. + chunked (true):: Whether chunked transfer-encoding is enabled for HTTP/1.1 connections. @@ -105,7 +113,7 @@ This option can be updated at any time using the inactivity_timeout (300000):: -Time in ms with nothing received at all before Cowboy closes the connection. +**DEPRECATED** Time in ms with nothing received at all before Cowboy closes the connection. initial_stream_flow_size (65535):: @@ -156,6 +164,13 @@ max_skip_body_length (1000000):: Maximum length Cowboy is willing to skip when the user code did not read the body fully. When the remaining length is too large or unknown Cowboy will close the connection. +protocols ([http2, http]):: + +Protocols that may be used when the client connects over +cleartext TCP. The default is to allow both HTTP/1.1 and +HTTP/2. HTTP/1.1 and HTTP/2 can be disabled entirely by +omitting them from the list. + proxy_header (false):: Whether incoming connections have a PROXY protocol header. The @@ -183,6 +198,7 @@ Ordered list of stream handlers that will handle all stream events. == Changelog +* *2.13*: The `inactivity_timeout` option was deprecated. * *2.13*: The `active_n` default value was changed to `1`. * *2.13*: The `dynamic_buffer` and `hibernate` options were added. * *2.11*: The `reset_idle_timeout_on_send` option was added. diff --git a/doc/src/manual/cowboy_http2.asciidoc b/doc/src/manual/cowboy_http2.asciidoc index 0dcfe2c..7b34b88 100644 --- a/doc/src/manual/cowboy_http2.asciidoc +++ b/doc/src/manual/cowboy_http2.asciidoc @@ -18,6 +18,7 @@ as a Ranch protocol. ---- opts() :: #{ active_n => pos_integer(), + alpn_default_protocol => http | http2, connection_type => worker | supervisor, connection_window_margin_size => 0..16#7fffffff, connection_window_update_threshold => 0..16#7fffffff, @@ -46,6 +47,7 @@ opts() :: #{ max_stream_buffer_size => non_neg_integer(), max_stream_window_size => 0..16#7fffffff, preface_timeout => timeout(), + protocols => [http | http2], proxy_header => boolean(), reset_idle_timeout_on_send => boolean(), sendfile => boolean(), @@ -76,6 +78,12 @@ values reduce the number of times Cowboy need to request more packets from the port driver at the expense of potentially higher memory being used. +alpn_default_protocol (http):: + +Default protocol to use when the client connects over TLS +without ALPN. Can be set to `http2` to disable HTTP/1.1 +entirely. + connection_type (supervisor):: Whether the connection process also acts as a supervisor. @@ -133,7 +141,7 @@ Time in ms with no data received before Cowboy closes the connection. inactivity_timeout (300000):: -Time in ms with nothing received at all before Cowboy closes the connection. +**DEPRECATED** Time in ms with nothing received at all before Cowboy closes the connection. initial_connection_window_size (65535):: @@ -259,6 +267,13 @@ preface_timeout (5000):: Time in ms Cowboy is willing to wait for the connection preface. +protocols ([http2, http]):: + +Protocols that may be used when the client connects over +cleartext TCP. The default is to allow both HTTP/1.1 and +HTTP/2. HTTP/1.1 and HTTP/2 can be disabled entirely by +omitting them from the list. + proxy_header (false):: Whether incoming connections have a PROXY protocol header. The @@ -306,6 +321,7 @@ too many `WINDOW_UPDATE` frames. == Changelog +* *2.13*: The `inactivity_timeout` option was deprecated. * *2.13*: The `active_n` default value was changed to `1`. * *2.13*: The `dynamic_buffer` and `hibernate` options were added. * *2.11*: Websocket over HTTP/2 is now considered stable. diff --git a/doc/src/manual/cowboy_req.set_resp_headers.asciidoc b/doc/src/manual/cowboy_req.set_resp_headers.asciidoc index 63fe424..9ca5901 100644 --- a/doc/src/manual/cowboy_req.set_resp_headers.asciidoc +++ b/doc/src/manual/cowboy_req.set_resp_headers.asciidoc @@ -11,7 +11,7 @@ cowboy_req:set_resp_headers - Set several response headers set_resp_headers(Headers, Req :: cowboy_req:req()) -> Req -Headers :: cowboy:http_headers() +Headers :: cowboy:http_headers() | [{binary(), iodata()}] ---- Set several headers to be sent with the response. @@ -32,8 +32,16 @@ instead of this function to set cookies. Headers:: -Headers as a map with keys being lowercase binary strings, -and values as binary strings. +Headers as a map with names being lowercase binary strings, +and values as iodata; or as a list with the same requirements +for names and values. ++ +When a list is given it is converted to its equivalent map, +with duplicate headers concatenated with a comma inserted +in-between. Support for lists is meant to simplify using +data from clients or other applications. ++ +The set-cookie header must not be set using this function. Req:: @@ -48,6 +56,7 @@ otherwise the headers will not be sent in the response. == Changelog +* *2.13*: The function now accepts a list of headers. * *2.0*: Function introduced. == Examples |