Represents a single incoming WebSocket message as an InputStream.
Represents a single outgoing WebSocket message as an OutputStream.
Represents a single WebSocket connection.
Exception thrown by vibe.http.websockets.
Returns a WebSocket client object that is connected to the specified host.
Scheduled for deprecation - use a @safe callback instead.
Establishes a web socket conection and passes it to the on_handshake delegate.
Scheduled for deprecation - use a @safe callback instead.
Returns a HTTP request handler that establishes web socket conections.
Scheduled for deprecation - use a @safe callback instead.
Scheduled for deprecation - use a @safe callback instead.
void handleConn(scope WebSocket sock) { // simple echo server while (sock.connected) { auto msg = sock.receiveText(); sock.send(msg); } } void startServer() { import vibe.http.router; auto router = new URLRouter; router.get("/ws", handleWebSockets(&handleConn)); // Start HTTP server using listenHTTP()... }
© 2012-2014 RejectedSoftware e.K.
Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Implements WebSocket support and fallbacks for older browsers.