1

Does rikulo stream v 0.7.2 support web sockets with different channels? I have seen so far only examples with static resource files.

Gero
  • 12,993
  • 25
  • 65
  • 106

1 Answers1

1

To handle Web Socket, you can use WebSocketTransformer to upgrade HTTP connection to WebSocket connection:

new StreamServer(uriMapping: {
  "/cmd", (HttpConnect connect) =>
      WebSocketTransformer.upgrade(connect.request)
      .then((websocket) {
        websocket.listen((evt) {
          websocket.add("Server received: $evt");
        });
        return socket.done;
      })
}).start();

Note: Web Socket is supported directly since Rikulo Stream 0.8.0. Please refer to the WebSocket Handling section.

Tom Yeh
  • 1,987
  • 2
  • 15
  • 23
  • big thx for the answer and the links. At first glance it does not look trivial :/. I guess that I will have to read the whole documentation? – Gero May 20 '13 at 10:42