Cowboy 2.6 greatly refactored the HTTP/2 code, a large part of which was moved to Cowlib and is now used by both the Cowboy server and the Gun client.
A large number of tickets were also closed which resulted in many bugs fixed and many features and options added, although some of them are still experimental.
proxy_header
option.
The proxy information can then be found under
the proxy_info
key in the Req object.
cowboy_req:stream_body/3
and in the data command in stream handlers. The only
caveat is that when using cowboy_compress_h
the
sendfile tuples may have to be converted to in-memory
data in order to compress them. This is the case for
gzip compression.
cowboy_stream_h
and
cowboy_compress_h
are now documented.
chunked
option to allow disabling chunked
transfer-encoding for HTTP/1.1 connections.
http10_keepalive
option to allow disabling
keep-alive for HTTP/1.0 connections.
idle_timeout
option for HTTP/2.
sendfile
option to both HTTP/1.1 and HTTP/2.
It allows disabling the sendfile syscall entirely for
all connections. It is recommended to disable sendfile
when using VirtualBox shared folders.
rate_limited/2
callback to REST handlers.
deflate_opts
option to Websocket handlers that
allows configuring deflate options for the
permessage-deflate extension.
charset
option to cowboy_static
.
ranges_accepted/2
and
range_satisfiable/2
along with the user-specified
ProvideRangeCallback/2
.
auto
from ranges_accepted/2
.
Cowboy will call the configured ProvideCallback
and
then split the output automatically for the ranged response.
cowboy_static
.
{deflate, boolean()}
Websocket handler
command to disable permessage-deflate compression
temporarily.
compress_threshold
option which allows
configuring how much data must be present in a
response body to compress it. This only applies
to non-streamed bodies at this time.
compress_buffering
option which allows
controlling whether some buffering may be done
when streaming a response body. Change the default
behavior to not buffer to make sure it works by
default in all scenarios.
{set_options, map()}
command to stream
handlers and Websocket handlers. This can be used
to update options on a per-request basis. Allow
overriding the idle_timeout
option for both
HTTP/1.1 and Websocket, the cowboy_compress_h
options for HTTP/1.1 and HTTP/2 and the chunked
option for HTTP/1.1.
charsets_provided
when it is present in the accept header when using
REST handlers.
cowboy_metrics_h
.
cowboy_router
behavior has been
documented.