Class Handshake.Server$

  • Enclosing class:
    Handshake

    public static class Handshake.Server$
    extends java.lang.Object
    • Field Detail

      • MODULE$

        public static final Handshake.Server$ MODULE$
        Static reference to the singleton instance of this Scala object.
    • Constructor Detail

      • Server$

        public Server$()
    • Method Detail

      • websocketUpgrade

        public akka.util.OptionVal<UpgradeToWebSocketLowLevel> websocketUpgrade​(scala.collection.immutable.List<HttpHeader> headers,
                                                                                boolean hostHeaderPresent,
                                                                                WebSocketSettings settings,
                                                                                akka.event.LoggingAdapter log)
        Validates a client WebSocket handshake. Returns either OptionVal.Some(UpgradeToWebSocketLowLevel) or OptionVal.None

        From: http://tools.ietf.org/html/rfc6455#section-4.2.1

        1. An HTTP/1.1 or higher GET request, including a "Request-URI" [RFC2616] that should be interpreted as a /resource name/ defined in Section 3 (or an absolute HTTP/HTTPS URI containing the /resource name/).

        2. A |Host| header field containing the server's authority.

        3. An |Upgrade| header field containing the value "websocket", treated as an ASCII case-insensitive value.

        4. A |Connection| header field that includes the token "Upgrade", treated as an ASCII case-insensitive value.

        5. A |Sec-WebSocket-Key| header field with a base64-encoded (see Section 4 of [RFC4648]) value that, when decoded, is 16 bytes in length.

        6. A |Sec-WebSocket-Version| header field, with a value of 13.

        7. Optionally, an |Origin| header field. This header field is sent by all browser clients. A connection attempt lacking this header field SHOULD NOT be interpreted as coming from a browser client.

        8. Optionally, a |Sec-WebSocket-Protocol| header field, with a list of values indicating which protocols the client would like to speak, ordered by preference.

        9. Optionally, a |Sec-WebSocket-Extensions| header field, with a list of values indicating which extensions the client would like to speak. The interpretation of this header field is discussed in Section 9.1.

        10. Optionally, other header fields, such as those used to send cookies or request authentication to a server. Unknown header fields are ignored, as per [RFC2616].

        Parameters:
        headers - (undocumented)
        hostHeaderPresent - (undocumented)
        settings - (undocumented)
        log - (undocumented)
        Returns:
        (undocumented)