aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/cowboy_http.asciidoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/manual/cowboy_http.asciidoc')
-rw-r--r--doc/src/manual/cowboy_http.asciidoc88
1 files changed, 65 insertions, 23 deletions
diff --git a/doc/src/manual/cowboy_http.asciidoc b/doc/src/manual/cowboy_http.asciidoc
index 33d2888..96a5585 100644
--- a/doc/src/manual/cowboy_http.asciidoc
+++ b/doc/src/manual/cowboy_http.asciidoc
@@ -17,27 +17,32 @@ as a Ranch protocol.
[source,erlang]
----
opts() :: #{
- active_n => pos_integer(),
- chunked => boolean(),
- connection_type => worker | supervisor,
- http10_keepalive => boolean(),
- idle_timeout => timeout(),
- inactivity_timeout => timeout(),
- initial_stream_flow_size => non_neg_integer(),
- linger_timeout => timeout(),
- logger => module(),
- max_empty_lines => non_neg_integer(),
- max_header_name_length => non_neg_integer(),
- max_header_value_length => non_neg_integer(),
- max_headers => non_neg_integer(),
- max_keepalive => non_neg_integer(),
- max_method_length => non_neg_integer(),
- max_request_line_length => non_neg_integer(),
- max_skip_body_length => non_neg_integer(),
- proxy_header => boolean(),
- request_timeout => timeout(),
- sendfile => boolean(),
- stream_handlers => [module()]
+ active_n => pos_integer(),
+ alpn_default_protocol => http | http2,
+ chunked => boolean(),
+ connection_type => worker | supervisor,
+ dynamic_buffer => false | {pos_integer(), pos_integer()},
+ hibernate => boolean(),
+ http10_keepalive => boolean(),
+ idle_timeout => timeout(),
+ inactivity_timeout => timeout(),
+ initial_stream_flow_size => non_neg_integer(),
+ linger_timeout => timeout(),
+ logger => module(),
+ max_empty_lines => non_neg_integer(),
+ max_header_name_length => non_neg_integer(),
+ max_header_value_length => non_neg_integer(),
+ max_headers => non_neg_integer(),
+ max_keepalive => non_neg_integer(),
+ 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(),
+ sendfile => boolean(),
+ stream_handlers => [module()]
}
----
@@ -52,7 +57,7 @@ Ranch functions `ranch:get_protocol_options/1` and
The default value is given next to the option name:
-active_n (100)::
+active_n (1)::
The number of packets Cowboy will request from the socket at once.
This can be used to tweak the performance of the server. Higher
@@ -60,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.
@@ -74,6 +85,21 @@ connection_type (supervisor)::
Whether the connection process also acts as a supervisor.
+dynamic_buffer ({1024, 131072})::
+
+Cowboy will dynamically change the socket's `buffer` size
+depending on the size of the data it receives from the socket.
+This lets Cowboy use the optimal buffer size for the current
+workload.
++
+The dynamic buffer size functionality can be disabled by
+setting this option to `false`. Cowboy will also disable
+it by default when the `buffer` transport option is configured.
+
+hibernate (false)::
+
+Whether the connection process will hibernate automatically.
+
http10_keepalive (true)::
Whether keep-alive is enabled for HTTP/1.0 connections.
@@ -87,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)::
@@ -138,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
@@ -148,6 +181,11 @@ request_timeout (5000)::
Time in ms with no requests before Cowboy closes the connection.
+reset_idle_timeout_on_send (false)::
+
+Whether the `idle_timeout` gets reset when sending data
+to the socket.
+
sendfile (true)::
Whether the sendfile syscall may be used. It can be useful to disable
@@ -160,6 +198,10 @@ 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.
* *2.8*: The `active_n` option was added.
* *2.7*: The `initial_stream_flow_size` and `logger` options were added.
* *2.6*: The `chunked`, `http10_keepalive`, `proxy_header` and `sendfile` options were added.