0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 04:30:25 +00:00
Commit graph

9 commits

Author SHA1 Message Date
Loïc Hoguin
b2bd9ccfb5
Document cow_ws:frame in Cowboy for now 2017-10-02 18:06:06 +02:00
Loïc Hoguin
58e9e76814
Fix more documentation todos
I have decided not to include a manual page for
cowboy_stream_h at this point because it clashes
with the cowboy_stream manual page. This decision
will be revisited in the future.
2017-09-04 14:33:44 +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
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
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
cbc7056395
Update cowboy_websocket_manual 2016-12-22 18:13:25 +01:00
Alex Prut
b58093a3c7 Update websocket documentation: based on https://github.com/ninenines/cowboy/blob/master/examples/websocket/src/ws_handler.erl 2016-08-31 12:42:50 +02:00
Loïc Hoguin
4023e7f4e4 Convert the documentation to Asciidoc
A few small revisions were made, and Erlang.mk has been updated.
2016-01-14 13:37:20 +01:00
Renamed from doc/src/manual/cowboy_websocket.ezdoc (Browse further)