Class WebSocketUpgrade

java.lang.Object
dev.relism.flash.websocket.WebSocketUpgrade

public final class WebSocketUpgrade extends Object
WebSocket upgrade detection (RFC 6455 ยง4.2.1) and handshake response. Extracted from upgrade request and, if so, answering the 101 Switching Protocols handshake. The session loop itself lives in WebSocketLoop.
  • Field Details

    • REJECT_400

      public static final byte[] REJECT_400
  • Method Details

    • isWebSocketUpgrade

      public static boolean isWebSocketUpgrade(Request request)
      Whether request is a WebSocket upgrade request: Upgrade: websocket and a shared token-list scanner in Http1KeepAlive is what fixed the whole-value compare bug this check used to have too).
    • performHandshake

      public static void performHandshake(OutputStream out, Request request, ConnectionScratch scratch) throws IOException
      Writes and flushes the 101 Switching Protocols handshake response.
      Throws:
      IOException