Protected
Optional
connectionCallback to execute when a new connection is opened.
Protected
handlersHandlers that should be registered with any new socket connections.
Attaches event listeners & initial callback to the given socket. This is used by as the handler for new connections.
Route#socket
Register a callback to execute each time a new socket is opened. This can be used to perform basic setup/validation/authentication tasks.
Route.socket('/ws/endpoint')
.connected(MyCtrl, (ctrl: MyCtrl) => ctrl.connect)
Register a StateEvent
listener on the socket.
Route.socket('/ws/endpoint')
.event(MyEvent, MyCtrl, (ctrl: MyCtrl) => ctrl.myHandler)
StateEvent
Static
get
Helper class for building websocket APIs using first-class route syntax. This is returned by the
Route.socket(...)
method, so you'll probably want to use that.See
Route#socket
Example