public interface Router
Router
interface represents a means of routing
a session initiating request to the correct service. Typically
a service is chosen based on the sub-protocol provided in the
initiating request, however it can be chosen on any criteria
available in the request. An initiating request must contain
a Connection
header with the websocket
token according to RFC 6455 section 4.2.1. If the request does
not contain this token it is treated as a normal request and
a Service
will not be resolved.
If a service has been successfully chosen from the initiating
request the the value of Sec-WebSocket-Protocol
will
contain either the chosen protocol if a match was made with the
initiating request or null to indicate a default choice.
RouterContainer
Modifier and Type | Method and Description |
---|---|
Service |
route(Request request,
Response response)
This is used to route an incoming request to a service if
the request represents a WebSocket handshake as defined by
RFC 6455.
|
Service route(Request request, Response response)
request
- this is the request to use for routingresponse
- this is the response to establish the sessionCopyright © 2018. All rights reserved.