Module cowboy_protocol
HTTP protocol handler.
HTTP protocol handler.
The available options are:
- compress
- Whether to automatically compress the response
body when the conditions are met. Disabled by default.
- env
- The environment passed and optionally modified
by middlewares.
- max_empty_lines
- Max number of empty lines before a request.
Defaults to 5.
- max_header_name_length
- Max length allowed for header names.
Defaults to 64.
- max_header_value_length
- Max length allowed for header values.
Defaults to 4096.
- max_headers
- Max number of headers allowed.
Defaults to 100.
- max_keepalive
- Max number of requests allowed in a single
keep-alive session. Defaults to 100.
- max_request_line_length
- Max length allowed for the request
line. Defaults to 4096.
- middlewares
- The list of middlewares to execute when a
request is received.
- onrequest
- Optional fun that allows Req interaction before
any dispatching is done. Host info, path info and bindings are thus
not available at this point.
- onresponse
- Optional fun that allows replacing a response
sent by the application.
- timeout
- Time in milliseconds a client has to send the
full request line and headers. Defaults to 5000 milliseconds.
Note that there is no need to monitor these processes when using Cowboy as
an application as it already supervises them under the listener supervisor.
onrequest_fun() = fun((Req) -> Req)
onresponse_fun() = fun((cowboy_http:status(), cowboy_http:headers(), iodata(), Req) -> Req)
start_link(ListenerPid::pid(), Socket::inet:socket(), Transport::module(), Opts::any()) -> {ok, pid()}
Start an HTTP protocol process.
Generated by EDoc, Aug 16 2014, 11:28:19.