1.1 KiB
1.1 KiB
Handy-Http Websockets
The Websockets component provides an RFC-6455-compatible implementation of server-side websockets.
You can add websocket support to your server by using the WebSocketRequestHandler to handle requests that you'd like to upgrade to websockets. Typically, you'd use the PathHandler to map requests of a particular URL, say, GET /websocket, to the WebSocketRequestHandler.
All that you need to do is define a class that extends from WebSocketMessageHandler to override the callback methods you'd like to deal with, and provide your message handler when constructing the WebSocketRequestHandler.
Check out the example available in the project's source code!