Subject: [hybi] Server implementation of draft 03

From: Martyn Loughran <[email-masked]>
Date: Mon, 25 Oct 2010 16:00:40 +0100

Having implemented draft 03 support in em-websocket (a Ruby
eventmachine WebSocket server), I wanted to provide some feedback.

Closing the connection, specifically the handling of the message body:
------

If server and client send a close frame with empty body at the 'same'
time (i.e. before either frame has been received by the other party),
both server and client will assume that the close frame they receive
is an acknowledgement rather than a close initiation. Is this a
problem? If it is then close bodies should be enforced. If not then I
suspect close bodies will not be used since omitting them is simpler.

Unless of course the close body is designed for the exceptional case
when one party needs to know for sure which side initiated the closing
of the connection. Some guidance on this point would be helpful.

Framing examples
------

The example given in 4.6 were extremely useful for testing (especially
since there are currently no clients that I know of). It would be very
useful to add a some close examples to this list. For example

    Close request and response

      * 0x01 0x03 "uid"
      * 0x01 0x03 "uid"

The fact that, for example, a ping should result in a pong even after
a close has been initiated (4.4.1) is not made explicit - it's an edge
case that I missed first time round in any case. It could be worth
stating that explicitly or adding an example to demonstrate.

Pong message:
------

The paragraph following 4.4.3 is a duplicate of 4.4.2. Is that intentional?

Probably outside the scope of the spec - but I'd be interested to hear
how people envisage ping & pong being used. My feeling is that this is
an application concern - applications may need to verify the
connection in different circumstances - however some servers may
presumably decide to implement connection checking independently of
application code. Is the intention to leave this completely open at
the moment?

For those interested, the code is available here
http://github.com/igrigorik/em-websocket/blob/draft03/lib/em-websocket/framing03.rb

Cheers,
-- 
Martyn Loughran

@mloughran
@pusherapp