org.jboss.netty.handler.codec.http.websocketx

## Class WebSocketServerHandshakerFactory

- java.lang.Object
- - org.jboss.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory

-     public class WebSocketServerHandshakerFactory
      extends Object

  Instances the appropriate handshake class to use for servers

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WebSocketServerHandshakerFactory(String webSocketURL, String subprotocols, boolean allowExtensions)` Constructor
    `WebSocketServerHandshakerFactory(String webSocketURL, String subprotocols, boolean allowExtensions, long maxFramePayloadLength)` Constructor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `WebSocketServerHandshaker` | `newHandshaker(HttpRequest req)` Instances a new handshaker
    `void` | `sendUnsupportedWebSocketVersionResponse(Channel channel)` Return that we need cannot not support the web socket version

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### WebSocketServerHandshakerFactory

          public WebSocketServerHandshakerFactory(String webSocketURL,
                                          String subprotocols,
                                          boolean allowExtensions)

      Constructor
      Parameters:
        `subprotocols` - CSV of supported protocols. Null if sub protocols not supported.
        `allowExtensions` - Allow extensions to be used in the reserved bits of the web socket frame

    - #### WebSocketServerHandshakerFactory

          public WebSocketServerHandshakerFactory(String webSocketURL,
                                          String subprotocols,
                                          boolean allowExtensions,
                                          long maxFramePayloadLength)

      Constructor
      Parameters:
        `webSocketURL` - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
        `subprotocols` - CSV of supported protocols. Null if sub protocols not supported.
        `allowExtensions` - Allow extensions to be used in the reserved bits of the web socket frame
        `maxFramePayloadLength` - Maximum allowable frame payload length. Setting this value to your application's requirement may reduce denial of service attacks using long data frames.

  - ### Method Detail

    - #### newHandshaker

          public WebSocketServerHandshaker newHandshaker(HttpRequest req)

      Instances a new handshaker
      Returns:
        A new WebSocketServerHandshaker for the requested web socket version. Null if web socket version is not supported.

    - #### sendUnsupportedWebSocketVersionResponse

          public void sendUnsupportedWebSocketVersionResponse(Channel channel)

      Return that we need cannot not support the web socket version
      Parameters:
        `channel` - Channel

Copyright © 2008-2012 The Netty Project. All Rights Reserved.