Module cowboy

Convenience API to start and stop HTTP/HTTPS listeners.

Description

Convenience API to start and stop HTTP/HTTPS listeners.

Data Types

http_headers()

http_headers() = [{binary(), iodata()}]

http_status()

http_status() = non_neg_integer() | binary()

http_version()

http_version() = 'HTTP/1.1' | 'HTTP/1.0'

onrequest_fun()

onrequest_fun() = fun((Req) -> Req)

onresponse_fun()

onresponse_fun() = fun((http_status(), http_headers(), iodata(), Req) -> Req)

Function Index

set_env/3Convenience function for setting an environment value.
start_http/4Start an HTTP listener.
start_https/4Start an HTTPS listener.
start_spdy/4Start a SPDY listener.
stop_listener/1Stop a listener.

Function Details

set_env/3

set_env(Ref::ranch:ref(), Name::atom(), Value::any()) -> ok

Convenience function for setting an environment value.

Allows you to update live an environment value used by middlewares. This function is primarily intended to simplify updating the dispatch list used for routing.

start_http/4

start_http(Ref::ranch:ref(), NbAcceptors::non_neg_integer(), TransOpts::ranch_tcp:opts(), ProtoOpts::cowboy_protocol:opts()) -> {ok, pid()} | {error, any()}

Start an HTTP listener.

start_https/4

start_https(Ref::ranch:ref(), NbAcceptors::non_neg_integer(), TransOpts::ranch_ssl:opts(), ProtoOpts::cowboy_protocol:opts()) -> {ok, pid()} | {error, any()}

Start an HTTPS listener.

start_spdy/4

start_spdy(Ref::ranch:ref(), NbAcceptors::non_neg_integer(), TransOpts::ranch_ssl:opts(), ProtoOpts::cowboy_spdy:opts()) -> {ok, pid()} | {error, any()}

Start a SPDY listener.

stop_listener/1

stop_listener(Ref::ranch:ref()) -> ok

Stop a listener.


Generated by EDoc, Oct 28 2013, 11:09:20.