Chromium Code Reviews
DescriptionInitial web socket server implementation
This implements the web socket protocol as a request handler for
the HTTP server. The HTTP server have been updated with the
ability of getting the socket when a HTTP upgrade request is
processed. This way the web socket implementation is not builtin
to the HTTP server.
The API on the server is:
interface WebSocketConnection {
void set onMessage(void callback(Object message));
void set onClosed(void callback(int status, String reason));
void set onError(void callback(e));
send(Object message);
close([int status, String reason]);
}
This API currently does not have any streaming but collects the
entire message before invoking the onMessage callback. The
current browser web socket API
(http://dev.w3.org/html5/websockets/) works the same way. The
underlying web socket protocol can have unbounded messages so
long term this probably have to change. But for now the only
likely client for a web socket server is a browser.
Currently this is missing tests. The implementation has been
tested by running the WebSocketTest.dart script and connecting
using a browser. This testing have been done using Chrome 19 and
Firefox 11.
I will be adding tests in separate change lists.
The SHA-1 and base 64 code (initially written by
ajohnsen@google.com) can be removed when these algorithms is
available in the dart:crypto.
R=ager@google.com, ajohnsen@google.com, vsm@google.com, jacobr@google.com
BUG=dart:2001
TEST=none
Committed: https://code.google.com/p/dart/source/detail?r=6998
Patch Set 1 #
Total comments: 28
Patch Set 2 : Addressed review comments from ajohnsen@ and ager@ #
Total comments: 6
Patch Set 3 : Addressed review comments from vsm@ #
Messages
Total messages: 9 (0 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||