public final class WebSocketHandshake extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_HEADER_SIZE |
| Constructor and Description |
|---|
WebSocketHandshake(int aVersion,
URI aURI,
String aProtocol) |
| Modifier and Type | Method and Description |
|---|---|
static String |
calcHybiSecKeyAccept(String aKey) |
byte[] |
generateC2SRequest() |
byte[] |
generateC2SRequest(List<HttpCookie> aCookies)
Generates the initial Handshake from a Java Client to the WebSocket
Server.
|
static byte[] |
generateS2CResponse(Map aRequest)
Generates the response for the server to answer an initial client
request.
|
static Map |
parseC2SRequest(byte[] aReq,
boolean aIsSSL)
Parses the response from the client on an initial client's handshake
request.
|
static Map |
parseS2CResponse(byte[] aResp) |
static byte[] |
readS2CResponse(InputStream aIS)
Reads the handshake response from the server into an byte array.
|
void |
verifyServerHandshakeHeaders(Map<String,String> aHeaders) |
void |
verifyServerResponse(Headers aHeaders) |
void |
verifyServerStatusLine(String aStatusLine) |
public WebSocketHandshake(int aVersion,
URI aURI,
String aProtocol)
throws WebSocketException
aURI - aProtocol - aVersion - WebSocketExceptionpublic static Map parseC2SRequest(byte[] aReq, boolean aIsSSL)
aReq - aIsSSL - public static byte[] generateS2CResponse(Map aRequest)
aRequest - public static byte[] readS2CResponse(InputStream aIS)
aIS - public static Map parseS2CResponse(byte[] aResp)
aResp - public byte[] generateC2SRequest(List<HttpCookie> aCookies)
public byte[] generateC2SRequest()
public void verifyServerResponse(Headers aHeaders) throws WebSocketException
aBytes - WebSocketExceptionpublic void verifyServerStatusLine(String aStatusLine) throws WebSocketException
aStatusLine - WebSocketExceptionpublic void verifyServerHandshakeHeaders(Map<String,String> aHeaders) throws WebSocketException
aHeaders - WebSocketExceptionCopyright © 2013. All Rights Reserved.