diff options
author | Loïc Hoguin <[email protected]> | 2017-05-28 19:04:16 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-05-28 20:19:39 +0200 |
commit | 5f421f93bc36d73161f7aa8705da5ea3a3793807 (patch) | |
tree | 3111c6978ec7b562a2fcf0bbe76f09d653dc67ac /doc/src | |
parent | 8cb125dbb7c410cab862aac5a582e5dfa0e46772 (diff) | |
download | cowboy-5f421f93bc36d73161f7aa8705da5ea3a3793807.tar.gz cowboy-5f421f93bc36d73161f7aa8705da5ea3a3793807.tar.bz2 cowboy-5f421f93bc36d73161f7aa8705da5ea3a3793807.zip |
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.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/manual/cowboy_websocket.asciidoc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/src/manual/cowboy_websocket.asciidoc b/doc/src/manual/cowboy_websocket.asciidoc index b728edf..7979b97 100644 --- a/doc/src/manual/cowboy_websocket.asciidoc +++ b/doc/src/manual/cowboy_websocket.asciidoc @@ -134,7 +134,8 @@ timeout:: ---- opts() :: #{ compress => boolean(), - idle_timeout => timeout() + idle_timeout => timeout(), + req_filter => fun((cowboy_req:req()) -> map()) } ---- @@ -162,6 +163,13 @@ idle_timeout (60000):: connection open without receiving anything from the client. +req_filter:: + A function applied to the Req to compact it and + only keep required information. The Req is only + given back in the `terminate/3` callback. By default + it keeps the method, version, URI components and peer + information. + == Changelog * *2.0*: The Req object is no longer passed to Websocket callbacks. |