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

22 commits

Author SHA1 Message Date
Loïc Hoguin
3442acbe35 Run tests in parallel 2013-03-02 16:24:34 +01:00
Loïc Hoguin
0ba06578f2 Use random ports for tests 2013-03-02 14:39:05 +01:00
Loïc Hoguin
a357c49d1b New routing
Ultimately few things change, it's mostly just a nicer syntax and
slightly different expectations. The name of the value `dispatch`
did not change, because the previous dispatch values will now fail
if the code is not updated to using `cowboy_router:compile/1`.

No constraints have been implemented in this commit.
2013-01-28 16:53:09 +01:00
Loïc Hoguin
3b8a1365d1 Do not require inets for running tests anymore 2013-01-22 14:22:28 +01:00
Loïc Hoguin
8d69099508 Improve websocket close handling
We now always send a failure reason (bad protocol, bad encoding, etc.)
unless the closure was initiated by the client and it didn't send a
close code.

We now check that the close frames have a payload that is valid UTF-8,
unless they don't have a payload at all.

We now do not crash the process anymore when bad opcodes are sent, or
when the opcode 0 is sent before fragmentation was initiated.

Overall this makes us closer to full compliance with the RFC.
2013-01-14 16:20:33 +01:00
Loïc Hoguin
71b68d53d9 All frames sent from client to server MUST be masked
Good in theory, but implementations may vary. If something stops
working after this commit we might need some tweaks to support
existing clients.

Please try it and give feedback.
2013-01-12 16:04:35 +01:00
Loïc Hoguin
10e3692fa6 Remove support for Websocket hixie76 draft
It was only used by Safari 5.0.1 and possibly 5.1. Their market share
is dropping as we speak. It was also insecure (disabled in Firefox
for that reason).

This will allow us to make much more efficient and cleaner code for
the rest of the Websocket versions we support (drafts 7 to 17 + RFC),
which are pretty much all versions seen in the wild excluding the
one we're removing here.
2013-01-10 21:58:38 +01:00
Loïc Hoguin
9bfef7c715 Update autobahntestsuite to 0.5.2
Also small mostly insignificant changes to tests.
2013-01-10 19:54:10 +01:00
Loïc Hoguin
54063de2ff Hello 2013 2013-01-04 15:10:03 +01:00
Loïc Hoguin
1b3f510b7e Add middleware support
Middlewares allow customizing the request processing.

All existing Cowboy project are incompatible with this commit.
You need to change `{dispatch, Dispatch}` in the protocol options
to `{env, [{dispatch, Dispatch}]}` to fix your code.
2013-01-03 22:47:51 +01:00
Jeremy Ong
5f122d9fa6 Cancel timer only on websocket_data receives or sends
This commit prevents erlang messages from keeping a websocket connection
alive. Previously, the timer was canceled upon any activity. Now, the
timeout is only canceled when actual data is sent from the client. The
handler_loop_timeout/1 function is called from websocket_data/4 instead
of handler_before_loop/4. It is also called after every successful reply
in handler_call/4.
2012-12-22 18:32:15 +01:00
Loïc Hoguin
6d4e15705f Add {close, StatusCode, Payload} and fix {close, Payload} 2012-12-08 19:11:56 +01:00
Loïc Hoguin
5ef4a15b48 Allow passing the Req and an updated Opts when upgrading protocols 2012-12-03 15:52:09 +01:00
Loïc Hoguin
067958abd2 Add more frame types available in websocket replies
We can now reply empty close, ping and pong frames, or close
frames with a payload.

This means that we can send a frame and then close the connection
in a single operation.

If a close packet is sent, the connection is closed immediately,
even if there was frames that remained to be sent. Cowboy will
silently drop any extra frames in the list given as a reply.
2012-12-02 21:37:24 +01:00
Loïc Hoguin
916bfde1f8 Fix a test that worked intermittently 2012-11-27 17:31:54 +01:00
Loïc Hoguin
09914c4693 Allow websocket handlers to reply more than one frame
Instead of returning {text, Data}, you can now return
[{text, Data}, {text, Data2}, ...].
2012-10-11 21:46:43 +02:00
Loïc Hoguin
aeb86e70c1 Add crypto into the required applications
As suggested by @prof3ta.
2012-10-11 20:13:23 +02:00
Loïc Hoguin
e4124de2c7 Switch to Ranch for connection handling
This is the first of many API incompatible changes.

You have been warned.
2012-08-27 11:50:35 +02:00
Loïc Hoguin
0c2e2224e3 Update version to 0.6.0
Also update the CHANGELOG and copyright years.
2012-05-23 14:53:48 +02:00
Magnus Klaar
0b15ed914d Add support for fragmented websocket messages 2012-04-05 22:02:04 +02:00
Loïc Hoguin
7a68a38e5a Add ct tests for binary websocket frames 2011-12-22 20:19:05 +01:00
Loïc Hoguin
9800348c21 Move the websocket tests in a separate suite 2011-12-22 20:06:58 +01:00