aboutsummaryrefslogtreecommitdiffstats
path: root/doc
AgeCommit message (Collapse)Author
2024-03-14Cowboy 2.12.02.12.0Loïc Hoguin
2024-03-14Add max_fragmented_header_block_size HTTP/2 optionLoïc Hoguin
2024-01-25Refresh copyright linesLoïc Hoguin
2024-01-23Cowboy 2.11Loïc Hoguin
2024-01-23Document reset_idle_timeout_on_send optionLoïc Hoguin
2024-01-23Getting started must include relx in depsLoïc Hoguin
2024-01-23Update the guide with range requests supportLoïc Hoguin
Also update the list of headers cowboy_rest might set and tweak a small number of other items.
2024-01-22Document range requestsLoïc Hoguin
2024-01-17Add missing manual pages for cowboy_stream functionsLoïc Hoguin
2024-01-16REST: Allow generate_etag to return undefinedLoïc Hoguin
This allows conditionally generating an etag.
2024-01-16Recommend increasing max_frame_size_received HTTP/2 optionLoïc Hoguin
2024-01-08Document body reading in auto modeLoïc Hoguin
It is now tested both via cowboy_req:read_body and via cowboy_req:cast. Removes a bad example from the guide of body reading with period of infinity, which does not work.
2024-01-08Ensure HTTP/1.1 Websocket resets the trap_exit flagLoïc Hoguin
While we are identified as a supervisor in the tree, we no longer manage children processes at that point, so do not need to trap exit signals. Users can still enable trap_exit if they prefer to.
2024-01-08Always add vary: accept-encoding in cowboy_compress_hLoïc Hoguin
We must add it even if we don't end up compressing because it indicates that we might. This indication doesn't mean that the user agent's accept-encoding values will ever result in content encoding being applied.
2024-01-05Don't automatically compress when response has etagLoïc Hoguin
In the cowboy_compress_h stream handler. Otherwise this could cause issues with caching, with the etag being the same for compressed/uncompressed content. Users that wish to send etags AND compress will have to do it manually for the time being.
2024-01-05Add cowboy:get_env/2,3Loïc Hoguin
2024-01-04Rework and improve the decompress stream handlerLoïc Hoguin
The read buffer was changed into an iovec to avoid doing too many binary concatenations and allocations. Decompression happens transparently: when decoding gzip, the content-encoding header is removed (we only decode when "gzip" is the only encoding so nothing remains). We always add a content_decoded key to the Req object. This key contains a list of codings that were decoded, in the reverse order in which they were. Currently it can only be empty or contain <<"gzip">> but future improvements or user handlers may see it contain more values. The option to disable decompression was renamed to decompress_enabled and defaults to true. It is no longer possible to enable/disable decompression in the middle of reading the body: this ensures that the data we pass forward is always valid. Various smaller improvements were made to the code, tests and manual pages.
2023-12-21Add cowboy_decompress_h stream handlerjdamanalo
2023-12-15Add timeout to cowboy_loopjdamanalo
LH: I have added a test that does both hibernate and timeout and fixed a related issue. I also tweaked the docs and tests.
2023-12-12Handle socket errors in HTTP/1.1 and HTTP/2Loïc Hoguin
Doing so will let us notice when the connection is gone instead of waiting for timeouts, at least in the cases where the remote socket was closed properly. Timeouts are still needed in case of TCP half-open problems. This change means that the order of stream handler commands is more important than before because socket errors may occur during the processing of commands.
2023-12-07Fix position of rate_limited/2 callback in REST workflow guideLoïc Hoguin
2023-12-07Fix Websocket subprotocol exampleLoïc Hoguin
2023-12-06Fix typos in documentationKian-Meng, Ang
2023-12-06Add 'max_cancel_stream_rate' config for the rapid reset attackViktor Söderqvist
Co-authored-by: Björn Svensson <[email protected]>
2023-05-02Fix Ranch link in user guideLoïc Hoguin
2023-04-28Cowboy 2.10.02.10.0Loïc Hoguin
2021-05-12Cowboy 2.9.02.9.0Loïc Hoguin
2021-04-24Two more HTTP specsLoïc Hoguin
2020-11-27AcceptCallback may now return created/see_other tuples for POSTMartin Björklund
They replace and deprecate the {true,URI} return value.
2020-11-27Graceful shutdownViktor Söderqvist
Note: This commit makes cowboy depend on cowlib master. Graceful shutdown for HTTP/2: 1. A GOAWAY frame with the last stream id set to 2^31-1 is sent and a timer is started (goaway_initial_timeout, default 1000ms), to wait for any in-flight requests sent by the client, and the status is set to 'closing_initiated'. If the client responds with GOAWAY and closes the connection, we're done. 2. A second GOAWAY frame is sent with the actual last stream id and the status is set to 'closing'. If no streams exist, the connection terminates. Otherwise a second timer (goaway_complete_timeout, default 3000ms) is started, to wait for the streams to complete. New streams are not accepted when status is 'closing'. 3. If all streams haven't completed after the second timeout, the connection is forcefully terminated. Graceful shutdown for HTTP/1.x: 1. If a request is currently being handled, it is waited for and the response is sent back to the client with the header "Connection: close". Then, the connection is closed. 2. If the current request handler is not finished within the time configured in transport option 'shutdown' (default 5000ms), the connection process is killed by its supervisor (ranch). Implemented for HTTP/1.x and HTTP/2 in the following scenarios: * When receiving exit signal 'shutdown' from the supervisor (e.g. when cowboy:stop_listener/3 is called). * When a connection process is requested to terminate using sys:terminate/2,3. LH: Edited tests a bit and added todos for useful tests to add.
2020-08-19Minor grammar correctionsThomas Sciaroni
Verb agreement error "The request process executes middlewares which, by default, including the router and then the execution of handlers." -> "The request process executes middlewares. By default, the request process executes the router and then the handlers." Adverbial clause at beginning of sentence needs comma "By default Cowboy comes..." -> "By default, Cowboy comes..."
2020-07-01Tweak a sentence in the guideLoïc Hoguin
Thanks Tamir Halperin for pointing this out. [skip ci]
2020-05-28Fix the cowboy_req:inform/3 example in the manualLoïc Hoguin
2020-05-21Cowboy 2.8.0Loïc Hoguin
2020-05-20Increase the default max_keepalive HTTP option to 1000Loïc Hoguin
100 is very low for current deployments. 1000 is more appropriate as a default value.
2020-05-20Clarify the routing algorithmLoïc Hoguin
2020-04-08Document the HTTP/2 linger_timeout optionLoïc Hoguin
2020-04-08Clarify that protocol opts may be defined by stream handlersLoïc Hoguin
2020-03-30Add more headers to cowboy_req:parse_header/2,3Loïc Hoguin
2020-03-29Increase the default max_received_frame_rateLoïc Hoguin
Allow 10000 frames every 10 seconds instead of just 1000, as the limit was too quickly reached in some deployments.
2020-03-29Add more specificationsLoïc Hoguin
2020-02-08Add Trace Context to the list of specsLoïc Hoguin
2020-02-08Clarify modifying/adding to the Req objectLoïc Hoguin
2020-01-06Fix cowboy_req:parse_header manual for unknown headersLoïc Hoguin
2020-01-06Add a skeleton performance chapter to the guideLoïc Hoguin
2020-01-06Use active,NLoïc Hoguin
This reduces the number of times we need to ask for more packets, and as a result we get a fairly large boost in performance, especially with HTTP/1.1. Unfortunately this makes Cowboy require at least Erlang/OTP 21.3+ because the ssl application did not have active,N. For simplicity the version required will be Erlang/OTP 22+. In addition this change improves hibernate handling in cowboy_websocket. Hibernate will now work for HTTP/2 transport as well, and stray or unrelated messages will no longer cancel hibernate (the process will handle the message and go back into hibernation). Thanks go to Stressgrid for benchmarking an early version of this commit: https://stressgrid.com/blog/cowboy_performance_part_2/
2019-12-31No longer use erlang:get_stacktrace/0Loïc Hoguin
It has been deprecated in OTP and the new way is available on all supported OTP versions.
2019-12-31Add new RFCs to the listLoïc Hoguin
2019-10-10Cowboy 2.7.0Loïc Hoguin
2019-10-10Fix a number of low hanging todosLoïc Hoguin