Packages

trait WebSocketUpgrade extends AnyRef

An attribute that WebSocket requests will contain. Use WebSocketUpgrade.handleMessagesWith to create a WebSocket handshake response and handle the WebSocket message stream with the given handler.

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

Source
WebSocketUpgrade.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. WebSocketUpgrade
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def getRequestedProtocols(): Iterable[String]

    Returns the sequence of protocols the client accepts.

    Returns the sequence of protocols the client accepts.

    See http://tools.ietf.org/html/rfc6455#section-1.9

  2. abstract def handleMessagesWith(inSink: Graph[SinkShape[Message], _], outSource: Graph[SourceShape[Message], _], subprotocol: String): HttpResponse

    Returns a response that can be used to answer a WebSocket handshake request.

    Returns a response that can be used to answer a WebSocket handshake request. The connection will afterwards use the given inSink to handle WebSocket messages from the client and the given outSource to send messages to the client.

    The given subprotocol must be one of the ones offered by the client.

  3. abstract def handleMessagesWith(inSink: Graph[SinkShape[Message], _], outSource: Graph[SourceShape[Message], _]): HttpResponse

    Returns a response that can be used to answer a WebSocket handshake request.

    Returns a response that can be used to answer a WebSocket handshake request. The connection will afterwards use the given inSink to handle WebSocket messages from the client and the given outSource to send messages to the client.

  4. abstract def handleMessagesWith(handlerFlow: Graph[FlowShape[Message, Message], _], subprotocol: String): HttpResponse

    Returns a response that can be used to answer a WebSocket handshake request.

    Returns a response that can be used to answer a WebSocket handshake request. The connection will afterwards use the given handlerFlow to handle WebSocket messages from the client. The given subprotocol must be one of the ones offered by the client.

  5. abstract def handleMessagesWith(handlerFlow: Graph[FlowShape[Message, Message], _]): HttpResponse

    Returns a response that can be used to answer a WebSocket handshake request.

    Returns a response that can be used to answer a WebSocket handshake request. The connection will afterwards use the given handlerFlow to handle WebSocket messages from the client.