| 1 |
= cowboy(7) |
| 2 |
|
| 3 |
== Name |
| 4 |
|
| 5 |
cowboy - Small, fast, modern HTTP server for Erlang/OTP |
| 6 |
|
| 7 |
== Description |
| 8 |
|
| 9 |
Cowboy is an HTTP server for Erlang/OTP with support for the |
| 10 |
HTTP/1.1, HTTP/2 and Websocket protocols. |
| 11 |
|
| 12 |
Cowboy aims to provide a complete HTTP stack. This includes |
| 13 |
the implementation of the HTTP RFCs but also any directly |
| 14 |
related standards, like Websocket or Server-Sent Events. |
| 15 |
|
| 16 |
== Modules |
| 17 |
|
| 18 |
Functions: |
| 19 |
|
| 20 |
* link:man:cowboy(3)[cowboy(3)] - Listener management |
| 21 |
* link:man:cowboy_req(3)[cowboy_req(3)] - Request and response |
| 22 |
* link:man:cowboy_router(3)[cowboy_router(3)] - Router |
| 23 |
* link:man:cowboy_constraints(3)[cowboy_constraints(3)] - Constraints |
| 24 |
|
| 25 |
Protocols: |
| 26 |
|
| 27 |
* link:man:cowboy_http(3)[cowboy_http(3)] - HTTP/1.1 |
| 28 |
* link:man:cowboy_http2(3)[cowboy_http2(3)] - HTTP/2 |
| 29 |
* link:man:cowboy_websocket(3)[cowboy_websocket(3)] - Websocket |
| 30 |
|
| 31 |
Handlers: |
| 32 |
|
| 33 |
* link:man:cowboy_static(3)[cowboy_static(3)] - Static file handler |
| 34 |
|
| 35 |
Stream handlers: |
| 36 |
|
| 37 |
* link:man:cowboy_stream_h(3)[cowboy_stream_h(3)] - Default stream handler |
| 38 |
* link:man:cowboy_compress_h(3)[cowboy_compress_h(3)] - Compress stream handler |
| 39 |
* link:man:cowboy_decompress_h(3)[cowboy_decompress_h(3)] - Decompress stream handler |
| 40 |
* link:man:cowboy_metrics_h(3)[cowboy_metrics_h(3)] - Metrics stream handler |
| 41 |
* link:man:cowboy_tracer_h(3)[cowboy_tracer_h(3)] - Tracer stream handler |
| 42 |
|
| 43 |
Behaviors: |
| 44 |
|
| 45 |
* link:man:cowboy_handler(3)[cowboy_handler(3)] - Plain HTTP handlers |
| 46 |
* link:man:cowboy_loop(3)[cowboy_loop(3)] - Loop handlers |
| 47 |
* link:man:cowboy_middleware(3)[cowboy_middleware(3)] - Middlewares |
| 48 |
* link:man:cowboy_rest(3)[cowboy_rest(3)] - REST handlers |
| 49 |
* link:man:cowboy_stream(3)[cowboy_stream(3)] - Stream handlers |
| 50 |
* link:man:cowboy_websocket(3)[cowboy_websocket(3)] - Websocket handlers |
| 51 |
|
| 52 |
Middlewares: |
| 53 |
|
| 54 |
* link:man:cowboy_router(3)[cowboy_router(3)] - Router middleware |
| 55 |
* link:man:cowboy_handler(3)[cowboy_handler(3)] - Handler middleware |
| 56 |
|
| 57 |
// @todo http_status_codes is not linked to; what to do with it? |
| 58 |
|
| 59 |
== Dependencies |
| 60 |
|
| 61 |
* link:man:ranch(7)[ranch(7)] - Socket acceptor pool for TCP protocols |
| 62 |
* link:man:cowlib(7)[cowlib(7)] - Support library for manipulating Web protocols |
| 63 |
* ssl - Secure communication over sockets |
| 64 |
* crypto - Crypto functions |
| 65 |
|
| 66 |
All these applications must be started before the `cowboy` |
| 67 |
application. To start Cowboy and all dependencies at once: |
| 68 |
|
| 69 |
[source,erlang] |
| 70 |
---- |
| 71 |
{ok, _} = application:ensure_all_started(cowboy). |
| 72 |
---- |
| 73 |
|
| 74 |
== Environment |
| 75 |
|
| 76 |
The `cowboy` application does not define any application |
| 77 |
environment configuration parameters. |
| 78 |
|
| 79 |
== See also |
| 80 |
|
| 81 |
link:man:ranch(7)[ranch(7)], |
| 82 |
link:man:cowlib(7)[cowlib(7)] |