org.springframework.web.socket.server

## Interface HandshakeHandler

- All Known Implementing Classes:
    DefaultHandshakeHandler, WebSocketTransportHandler

      public interface HandshakeHandler

  Contract for processing a WebSocket handshake request.
  Since:
    4.0
  Author:
    Rossen Stoyanchev
  See Also:
    `HandshakeInterceptor`, `WebSocketHttpRequestHandler`, `SockJsService`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `doHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String,Object> attributes)` Initiate the handshake.

- - ### Method Detail

    - #### doHandshake

          boolean doHandshake(ServerHttpRequest request,
                              ServerHttpResponse response,
                              WebSocketHandler wsHandler,
                              Map<String,Object> attributes)
                       throws HandshakeFailureException

      Initiate the handshake.
      Parameters:
        `request` - the current request
        `response` - the current response
        `wsHandler` - the handler to process WebSocket messages; see `PerConnectionWebSocketHandler` for providing a handler with per-connection lifecycle.
        `attributes` - attributes from the HTTP handshake to associate with the WebSocket session; the provided attributes are copied, the original map is not used.
      Returns:
        whether the handshake negotiation was successful or not. In either case the response status, headers, and body will have been updated to reflect the result of the negotiation
      Throws:
        `HandshakeFailureException` - thrown when handshake processing failed to complete due to an internal, unrecoverable error, i.e. a server error as opposed to a failure to successfully negotiate the handshake.