0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 04:10:24 +00:00
Commit graph

17 commits

Author SHA1 Message Date
Loïc Hoguin
58909b0144
Initial WebTransport implementation
This implements the upcoming draft-13
but has bits to make it work with draft-02
that most (all?) Chromium versions use.

Data and events are not going through
cowboy_stream beyond init. Since this
approach appears to work well it may
be a good idea to do the same for
Websocket over HTTP/2+ and improve
its performance.
2025-06-19 16:27:07 +02:00
Loïc Hoguin
eef66e0928
Remove copyright years from all files except LICENSE 2025-02-17 15:00:02 +01:00
Loïc Hoguin
b36f064a91
Refresh copyright lines 2024-01-25 11:22:54 +01:00
Loïc Hoguin
240da3f2d9
Add the set_options stream handler command
The first two options to benefit from this are the
cowboy_compress_h options.
2018-11-15 18:53:42 +01:00
Loïc Hoguin
d7b7580b39
Add sendfile support to cowboy_req:stream_body
It is now possible to stream one or more sendfile tuples.
A simple example of what can now be done would be for
example to build a tar file on the fly using the sendfile
syscall for sending the files, or to support Range requests
with more than one range with the sendfile syscall.

When using cowboy_compress_h unfortunately we have to read
the file in order to send it. More options will be added
at a later time to make sure users don't read too much
into memory. This is a new feature however so existing
code is not affected.

Also rework cowboy_http's data sending to be flatter.
2018-11-09 17:42:37 +01:00
Loïc Hoguin
d4129e6305
Exit gracefully on parent exit/sys:terminate/2,3 2018-10-28 10:20:43 +01:00
Loïc Hoguin
4b65a307f8
Add missing log command to the commands() type 2018-08-06 13:31:44 +02:00
Loïc Hoguin
a76c32db5e
Introduce undocumented option logger
This commit reworks the logging that Cowboy does via
error_logger to make the module that will do the actual
logging configurable.

The logger module interface must be the same as logger
and lager: a separate function per log level with the
same log levels they support.

The default behavior remains to call error_logger,
although some messages were downgraded to warnings
instead of errors. Since error_logger only supports
three different log levels, some messages may get
downgraded/upgraded depending on what the original
log level was to make them compatible with error_logger.

The {log, Level, Format, Args} command was also
added to stream handlers. Stream handlers should
use this command to log messages because it allows
writing a stream handler to intercept some of those
messages and extract information or block them as
necessary.

The logger option only applies to Cowboy itself,
not to the messages Ranch logs, so more work remains
to be done in that area.
2018-06-28 17:10:18 +02:00
Loïc Hoguin
34473bc247
Fix Dialyzer warnings 2017-12-13 12:40:00 +01:00
Loïc Hoguin
4bebe39975
Ensure stream terminate is called when switching protocols 2017-10-22 14:53:04 +01:00
Loïc Hoguin
292e732abf
Fix the documentation for the command flow 2017-10-02 10:46:45 +02:00
Loïc Hoguin
a6126306a2
Centralize stream handler error reporting in cowboy_stream 2017-09-21 12:53:21 +02:00
Loïc Hoguin
b403f26da6
Remove an outdated todo comment 2017-04-18 16:36:03 +02:00
Loïc Hoguin
10dfd8c910
Add the early_error cowboy_stream callback
This callback is called when an error occurs before the request
(including headers, excluding body) was fully received. The
init/3 callback will not be called. The callback receives the
partial Req object (possibly empty), the reason for the error
and the response command that the server will send. It allows
you to be aware of the error and possibly modify the response
before it is sent.
2017-03-27 10:26:13 +02:00
Loïc Hoguin
0f8452cafa
Add support for multiple stream handlers
The stream handlers can be specified using the protocol
option 'stream_handlers'. It defaults to [cowboy_stream_h].

The cowboy_stream_h module currently does not forward the
calls to further stream handlers. It feels like an edge
case; usually we'd want to put our own handlers between
the protocol code and the request process. I am therefore
going to focus on other things for now.

The various types and specifications for stream handlers
have been updated and the cowboy_stream module can now
be safely used as a behavior. The interface might change
a little more, though.

This commit does not include tests or documentation.
They will follow separately.
2017-01-16 14:36:33 +01:00
Loïc Hoguin
43adacc760
Welcome to 2017 2017-01-02 19:36:36 +01:00
Loïc Hoguin
a6f75aa3dc Add HTTP/2 support preview
This commit is not only an early preview of HTTP/2, it is an
early preview of the new Cowboy architecture that will be
presented tomorrow in my talk. If you have found it before
the talk, great! It's not complete so you better go watch
the talk anyway.
2015-06-11 17:04:21 +02:00