0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00
Commit graph

306 commits

Author SHA1 Message Date
Loïc Hoguin
3c18585945
Remove any mention of the waiting_stream hack 2017-07-12 18:55:09 +02:00
Loïc Hoguin
f425f7478a
Add another RFC to the pile 2017-06-28 12:07:28 +02:00
Loïc Hoguin
47eaadb209
Fix a confusing code snippet
Reported by Jordan Chaitin.
2017-06-14 15:07:31 +02:00
Loïc Hoguin
ec00e3d60e
Make cowboy_req:read_part return multipart headers as map 2017-06-09 16:57:11 +02:00
Loïc Hoguin
6f7b59886e
Remove NumAcceptors argument from start_clear/tls
They are now cowboy:start_clear/3 and cowboy:start_tls/3.
The NumAcceptors argument can be specified via the
num_acceptor transport option. Ranch has been updated
to 1.4.0 to that effect.
2017-06-07 15:15:54 +02:00
Loïc Hoguin
5f421f93bc
Introduce the req_filter Websocket option
This option allows customizing the compacting of the Req object
when using Websocket. By default it will keep most public fields
excluding headers of course, since those can be large.
2017-05-28 20:19:39 +02:00
Loïc Hoguin
8ed44cd9a9
Add another RFC to the list of specs 2017-05-20 12:35:20 +02:00
Loïc Hoguin
7db724f04a
Add inactivity_timeout and other options improvements 2017-05-05 13:48:25 +02:00
Loïc Hoguin
95d2855f62
Add the idle_timeout HTTP/1.1 protocol option
This fixes the connection being dropped because of request_timeout
despite there being some active streams.
2017-05-03 17:44:00 +02:00
Gary Rennie
73b4eb94ff
Update Websocket handler docs default timeout
This was changed from infinity to 60s in
a45813c60f
2017-04-18 17:51:21 +02:00
Loïc Hoguin
6e8b907ae2
Pass the HTTP/2 switch_protocol event to stream handlers
To accomplish this the code for sending the 101 response was
moved to the cowboy_http2 module.
2017-04-18 14:06:34 +02:00
Loïc Hoguin
3633bceac5
Add more RFCs to the specs list 2017-04-18 12:35:45 +02:00
Loïc Hoguin
c2beff7126
Initial cowboy_stream manual 2017-04-10 16:37:01 +02:00
Loïc Hoguin
14a01f71cb
Add a guide chapter linking to all specs 2017-03-20 14:21:42 +01:00
Loïc Hoguin
9255cdf1d7
Change the type of bindings from a list to a map
Maps make more sense because the keys are unique.
2017-02-19 16:51:16 +01:00
Loïc Hoguin
91ae70b06c
Change the order of set_resp_cookie arguments
The Opts value is put last, to be more consistent with the
rest of the cowboy_req module.

Additionally a test handler was fixed which reduced the number
of errors in http_SUITE.
2017-02-19 09:46:11 +01:00
Loïc Hoguin
87a05a1219
Change the type of cookie name to binary()
The API will be more consistent like this, and we can ensure
that duplicate cookie names are never sent.
2017-02-19 00:41:54 +01:00
Loïc Hoguin
a45813c60f
Allow passing options to sub protocols
Before this commit we had an issue where configuring a
Websocket connection was simply not possible without
doing magic, adding callbacks or extra return values.
The init/2 function only allowed setting hibernate
and timeout options.

After this commit, when switching to a different
type of handler you can either return

  {module, Req, State}

or

  {module, Req, State, Opts}

where Opts is any value (as far as the sub protocol
interface is concerned) and is ultimately checked
by the custom handlers.

A large protocol like Websocket would accept only
a map there, with many different options, while a
small interface like loop handlers would allow
passing hibernate and nothing else.

For Websocket, hibernate must be set from the
websocket_init/1 callback, because init/2 executes
in a separate process.

Sub protocols now have two callbacks: one with the
Opts value, one without.

The loop handler code was largely reworked and
simplified. It does not need to manage a timeout
or read from the socket anymore, it's the job of
the protocol code. A lot of unnecessary stuff was
therefore removed.

Websocket compression must now be enabled from
the handler options instead of per listener. This
means that a project can have two separate Websocket
handlers with different options. Compression is
still disabled by default, and the idle_timeout
value was changed from inifnity to 60000 (60 seconds),
as that's safer and is also a good value for mobile
devices.
2017-02-18 18:26:20 +01:00
Loïc Hoguin
f34ef2ceae
Improve the manual for the new resp_header functions 2017-01-04 19:21:23 +01:00
Johan Lövdahl
3f4e79d42f
Add functions for getting and setting response headers 2017-01-04 13:37:50 +01:00
Loïc Hoguin
43adacc760
Welcome to 2017 2017-01-02 19:36:36 +01:00
Loïc Hoguin
271e31c629
Various fixes and tweaks to the user guide 2017-01-02 14:46:19 +01:00
Loïc Hoguin
5838a0c81a
Add templates as Erlang.mk plugin 2016-12-28 17:54:50 +01:00
Loïc Hoguin
f7094ad78f
Update the cowboy_rest manual 2016-12-28 15:17:43 +01:00
Loïc Hoguin
afc7d08813
Leave a few manual pages for post 2.0.0-pre.4
In particular the cowboy_sub_protocol is subject to change soon.
Also the cowboy_stream behavior is going to be left hidden in
this release and enabled when it becomes easier to chain them.
2016-12-23 18:56:05 +01:00
Loïc Hoguin
3bcb1cb42e
Update cowboy_middleware 2016-12-23 18:52:02 +01:00
Loïc Hoguin
5da7d1ef05
Update cowboy_loop manual 2016-12-23 17:20:54 +01:00
Loïc Hoguin
b13c07932d
Update the cowboy_handler manual
Also fixes a small mistake in cowboy_websocket.
2016-12-23 15:33:21 +01:00
Loïc Hoguin
98ae01b599
Update the cowboy_static manual 2016-12-23 12:19:27 +01:00
Sasan Hezarkhani
56e489f00a
Updates cowboy_http documents changelog
The changelog had a wrong reference to an option that was updated.
`max_header_request_line_length` -> `max_request_line_length`
2016-12-22 23:56:48 +01:00
Loïc Hoguin
cbc7056395
Update cowboy_websocket_manual 2016-12-22 18:13:25 +01:00
Loïc Hoguin
e584412de7
Add the manual for cowboy_http2 2016-12-22 15:19:38 +01:00
Loïc Hoguin
a9d9c9d902
Add cowboy_http manual
Updates and replaces the cowboy_protocol manual.
2016-12-22 14:48:02 +01:00
Loïc Hoguin
a1b52494a5
Update the cowboy_router manual 2016-12-22 12:53:21 +01:00
Loïc Hoguin
ba14cf7838
Add man pages for the reply functions 2016-12-21 15:47:44 +01:00
Loïc Hoguin
c528d9b0f7
Add the man pages for body reading functions
[ci skip]
2016-12-02 16:50:55 +01:00
Loïc Hoguin
7b248e5163
Add man pages for the parse/match/binding cowboy_req functions 2016-11-07 18:03:47 +02:00
Loïc Hoguin
bd34dfdedd
Small tweak to Asciidoc
Fixes Hugo rendering.
2016-11-07 01:44:15 +02:00
Loïc Hoguin
b2e981ca40
Add man pages for parse_qs, match_qs and parse_header
[ci skip]
2016-11-07 01:12:30 +02:00
Loïc Hoguin
0df88c0d0a
Tweak small things in the cowboy manual 2016-11-05 14:22:18 +02:00
Loïc Hoguin
faca7866ed
Partially update manual for the cowboy_req
Only the access functions have been modified so far.
2016-11-05 14:17:30 +02:00
Loïc Hoguin
144c5c0cc7
Small tweaks to cowboy module manual 2016-10-01 13:33:48 +02:00
Loïc Hoguin
5477d613f9 Tweak the one-liner description of the project 2016-09-29 22:46:26 +02:00
Loïc Hoguin
e80291fbdc Tweak the cowboy(7) manual 2016-09-25 23:27:34 +02:00
Loïc Hoguin
fa58155f72 Update the cowboy(7) manual
It now links to all modules found in the manual and can therefore
easily act as an index for the application.
2016-09-25 23:14:19 +02:00
Loïc Hoguin
cef6e5b472 Fix whitespace in example 2016-09-25 18:46:47 +02:00
Loïc Hoguin
0424724062 Update manual for the cowboy module
This commit separates the documentation of the functions into
separate manual pages, with at least one example per function
and a lot more details about parameters, return values and
related functions and modules. It also includes a changelog
indicating when the function was added or changed.

The inspiration for this comes mainly from the PHP documentation
and feedback from users.
2016-09-25 17:32:41 +02:00
Loïc Hoguin
31cabe0fb9 Use spaces in snippets in the guide 2016-09-14 18:51:11 +02:00
Loïc Hoguin
a231216b07 Update the Websocket handlers chapter 2016-09-14 18:39:17 +02:00
Loïc Hoguin
06e1e2be68 Update the routing chapter 2016-09-04 19:47:09 +02:00