0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00
Small, fast, modern HTTP server for Erlang/OTP.
Find a file
Loïc Hoguin b370442a63 Initial commit with connection/streams
Breaking changes with previous commit. This is a very large change,
and I am giving up on making a single commit that fixes everything.
More commits will follow slowly adding back features, introducing
new tests and fixing the documentation.

This change contains most of the work toward unifying the interface
for handling both HTTP/1.1 and HTTP/2. HTTP/1.1 connections are now
no longer 1 process per connection; instead by default 1 process per
request is also created. This has a number of pros and cons.

Because it has cons, we also allow users to use a lower-level API
that acts on "streams" (requests/responses) directly at the connection
process-level. If performance is a concern, one can always write a
stream handler. The performance in this case will be even greater
than with Cowboy 1, although all the special handlers are unavailable.

When switching to Websocket, after the handler returns from init/2,
Cowboy stops the stream and the Websocket protocol takes over the
connection process. Websocket then calls websocket_init/2 for any
additional initialization such as timers, because the process is
different in init/2 and websocket_*/* functions. This however would
allow us to use websocket_init/2 for sending messages on connect,
instead of sending ourselves a message and be subject to races.
Note that websocket_init/2 is optional.

This is all a big change and while most of the tests pass, some
functionality currently doesn't. SPDY is broken and will be removed
soon in favor of HTTP/2. Automatic compression is currently disabled.
The cowboy_req interface probably still have a few functions that
need to be updated. The docs and examples do not refer the current
functionality anymore.

Everything will be fixed over time. Feedback is more than welcome.
Open a ticket!
2016-03-05 20:20:42 +01:00
doc/src Minor grammar improvements from Derek Brown 2016-01-15 16:16:56 +01:00
ebin Initial commit with connection/streams 2016-03-05 20:20:42 +01:00
examples Initial commit with connection/streams 2016-03-05 20:20:42 +01:00
src Initial commit with connection/streams 2016-03-05 20:20:42 +01:00
test Initial commit with connection/streams 2016-03-05 20:20:42 +01:00
.gitattributes Convert the documentation to Asciidoc 2016-01-14 13:37:20 +01:00
.gitignore Convert the documentation to Asciidoc 2016-01-14 13:37:20 +01:00
AUTHORS Update AUTHORS 2014-10-04 13:32:51 +03:00
CHANGELOG.md Update CHANGELOG 2014-10-04 15:50:53 +03:00
circle.yml Try an experimental Erlang.mk CI feature 2016-01-15 14:44:26 +01:00
CONTRIBUTING.asciidoc Update CONTRIBUTING 2015-11-16 18:55:53 +01:00
erlang.mk Initial commit with connection/streams 2016-03-05 20:20:42 +01:00
LICENSE Update copyright years 2014-02-06 19:57:23 +01:00
Makefile Update CI 2016-01-15 13:48:35 +01:00
README.md Update README.md 2015-12-11 14:04:39 -08:00
rebar.config Update Erlang.mk 2015-11-16 23:08:38 +01:00
ROADMAP.md Update ROADMAP 2014-10-04 13:26:40 +03:00

Cowboy

Cowboy is a small, fast and modular HTTP server written in Erlang.

Goals

Cowboy aims to provide a complete HTTP stack in a small code base. It is optimized for low latency and low memory usage, in part because it uses binary strings.

Cowboy provides routing capabilities, selectively dispatching requests to handlers written in Erlang.

Because it uses Ranch for managing connections, Cowboy can easily be embedded in any other application.

No parameterized module. No process dictionary. Clean Erlang code.

Sponsors

The project is currently sponsored by Sameroom.

The SPDY implementation was sponsored by LeoFS Cloud Storage.

Online documentation

Offline documentation

  • While still online, run make docs
  • Function reference man pages available in doc/man3/ and doc/man7/
  • Run make install-docs to install man pages on your system
  • Full documentation in Markdown available in doc/markdown/
  • Examples available in examples/

Getting help