This is a partial answer, it only addresses how to create a server that will listen for client WebSocket connections.
Have you seen the WebSocketTransformer class?
I haven't had a chance to try this yet - but I think it's something like this:
HttpServer.bind(...).then((server) {
server.transform(new WebSocketTransformer()).listen((webSocket) => ... );
});
Also see this discussion on the Dart mailing list.