Package dev.relism.flash.websocket
Class WebSocketUpgrade
java.lang.Object
dev.relism.flash.websocket.WebSocketUpgrade
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisWebSocketUpgrade(Request request) Whetherrequestis a WebSocket upgrade request:Upgrade: websocketand a shared token-list scanner inHttp1KeepAliveis what fixed the whole-value compare bug this check used to have too).static voidperformHandshake(OutputStream out, Request request, ConnectionScratch scratch) Writes and flushes the101 Switching Protocolshandshake response.
-
Field Details
-
REJECT_400
public static final byte[] REJECT_400
-
-
Method Details
-
isWebSocketUpgrade
Whetherrequestis a WebSocket upgrade request:Upgrade: websocketand a shared token-list scanner inHttp1KeepAliveis 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 the101 Switching Protocolshandshake response.- Throws:
IOException
-