public interface WebSocketUpgrade extends WebSocketUpgrade
This is a low-level API. You might want to use handleWebSocketMessages
instead as documented
at https://pekko.apache.org/docs/pekko-http/current/server-side/websocket-support.html#routing-support
Modifier and Type | Method and Description |
---|---|
org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<Message,Message>,org.apache.pekko.NotUsed> |
createScalaFlow(org.apache.pekko.stream.Graph<org.apache.pekko.stream.SinkShape<Message>,?> inSink,
org.apache.pekko.stream.Graph<org.apache.pekko.stream.SourceShape<Message>,?> outSource)
Java API
|
java.lang.Iterable<java.lang.String> |
getRequestedProtocols()
Java API
|
HttpResponse |
handleMessages(org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<Message,Message>,java.lang.Object> handlerFlow,
scala.Option<java.lang.String> subprotocol)
The high-level interface to create a WebSocket server based on "messages".
|
HttpResponse |
handleMessagesWith(org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<Message,Message>,?> handlerFlow)
Java API
|
HttpResponse |
handleMessagesWith(org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<Message,Message>,?> handlerFlow,
java.lang.String subprotocol)
Java API
|
HttpResponse |
handleMessagesWith(org.apache.pekko.stream.Graph<org.apache.pekko.stream.SinkShape<Message>,?> inSink,
org.apache.pekko.stream.Graph<org.apache.pekko.stream.SourceShape<Message>,?> outSource)
Java API
|
HttpResponse |
handleMessagesWith(org.apache.pekko.stream.Graph<org.apache.pekko.stream.SinkShape<Message>,?> inSink,
org.apache.pekko.stream.Graph<org.apache.pekko.stream.SourceShape<Message>,?> outSource,
java.lang.String subprotocol)
Java API
|
HttpResponse |
handleMessagesWithSinkSource(org.apache.pekko.stream.Graph<org.apache.pekko.stream.SinkShape<Message>,java.lang.Object> inSink,
org.apache.pekko.stream.Graph<org.apache.pekko.stream.SourceShape<Message>,java.lang.Object> outSource,
scala.Option<java.lang.String> subprotocol)
The high-level interface to create a WebSocket server based on "messages".
|
scala.collection.immutable.Seq<java.lang.String> |
requestedProtocols()
A sequence of protocols the client accepts.
|
org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<Message,Message>,org.apache.pekko.NotUsed> createScalaFlow(org.apache.pekko.stream.Graph<org.apache.pekko.stream.SinkShape<Message>,?> inSink, org.apache.pekko.stream.Graph<org.apache.pekko.stream.SourceShape<Message>,?> outSource)
inSink
- (undocumented)outSource
- (undocumented)java.lang.Iterable<java.lang.String> getRequestedProtocols()
getRequestedProtocols
in interface WebSocketUpgrade
HttpResponse handleMessages(org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<Message,Message>,java.lang.Object> handlerFlow, scala.Option<java.lang.String> subprotocol)
Returns a response to return in a request handler that will signal the low-level HTTP implementation to upgrade the connection to WebSocket and use the supplied handler to handle incoming WebSocket messages.
Optionally, a subprotocol out of the ones requested by the client can be chosen.
handlerFlow
- (undocumented)subprotocol
- (undocumented)HttpResponse handleMessagesWith(org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<Message,Message>,?> handlerFlow)
handleMessagesWith
in interface WebSocketUpgrade
handlerFlow
- (undocumented)HttpResponse handleMessagesWith(org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<Message,Message>,?> handlerFlow, java.lang.String subprotocol)
handleMessagesWith
in interface WebSocketUpgrade
handlerFlow
- (undocumented)subprotocol
- (undocumented)HttpResponse handleMessagesWith(org.apache.pekko.stream.Graph<org.apache.pekko.stream.SinkShape<Message>,?> inSink, org.apache.pekko.stream.Graph<org.apache.pekko.stream.SourceShape<Message>,?> outSource)
handleMessagesWith
in interface WebSocketUpgrade
inSink
- (undocumented)outSource
- (undocumented)HttpResponse handleMessagesWith(org.apache.pekko.stream.Graph<org.apache.pekko.stream.SinkShape<Message>,?> inSink, org.apache.pekko.stream.Graph<org.apache.pekko.stream.SourceShape<Message>,?> outSource, java.lang.String subprotocol)
handleMessagesWith
in interface WebSocketUpgrade
inSink
- (undocumented)outSource
- (undocumented)subprotocol
- (undocumented)HttpResponse handleMessagesWithSinkSource(org.apache.pekko.stream.Graph<org.apache.pekko.stream.SinkShape<Message>,java.lang.Object> inSink, org.apache.pekko.stream.Graph<org.apache.pekko.stream.SourceShape<Message>,java.lang.Object> outSource, scala.Option<java.lang.String> subprotocol)
Returns a response to return in a request handler that will signal the low-level HTTP implementation to upgrade the connection to WebSocket and use the supplied inSink to consume messages received from the client and the supplied outSource to produce message to sent to the client.
Optionally, a subprotocol out of the ones requested by the client can be chosen.
inSink
- (undocumented)outSource
- (undocumented)subprotocol
- (undocumented)scala.collection.immutable.Seq<java.lang.String> requestedProtocols()
See http://tools.ietf.org/html/rfc6455#section-1.9