RequestVerifier
in package
These are checks to ensure the client requested handshake are valid Verification rules come from section 4.2.1 of the RFC6455 document
Tags
Table of Contents
Constants
- VERSION = 13
Methods
- getPermessageDeflateOptions() : mixed
- verifyAll() : bool
- Given an array of the headers this method will run through all verification methods
- verifyConnection() : bool
- Verify the Connection header
- verifyExtensions() : mixed
- verifyHost() : bool
- verifyHTTPVersion() : bool
- Test the HTTP version passed. MUST be 1.1 or greater
- verifyKey() : bool
- This function verifies the nonce is valid (64 big encoded, 16 bytes random string)
- verifyMethod() : bool
- Test the HTTP method. MUST be "GET"
- verifyProtocol() : mixed
- verifyRequestURI() : bool
- verifyUpgradeRequest() : bool
- Verify the Upgrade request to WebSockets.
- verifyVersion() : bool
- Verify the version passed matches this RFC
Constants
VERSION
public
mixed
VERSION
= 13
Methods
getPermessageDeflateOptions()
public
getPermessageDeflateOptions(array<string|int, mixed> $requestHeader, array<string|int, mixed> $responseHeader) : mixed
Parameters
- $requestHeader : array<string|int, mixed>
- $responseHeader : array<string|int, mixed>
verifyAll()
Given an array of the headers this method will run through all verification methods
public
verifyAll(RequestInterface $request) : bool
Parameters
- $request : RequestInterface
Return values
bool —TRUE if all headers are valid, FALSE if 1 or more were invalid
verifyConnection()
Verify the Connection header
public
verifyConnection(array<string|int, mixed> $connectionHeader) : bool
Parameters
- $connectionHeader : array<string|int, mixed>
-
MUST include "Upgrade"
Return values
boolverifyExtensions()
public
verifyExtensions(mixed $val) : mixed
Parameters
- $val : mixed
Tags
verifyHost()
public
verifyHost(array<string|int, mixed> $hostHeader) : bool
Parameters
- $hostHeader : array<string|int, mixed>
Tags
Return values
boolverifyHTTPVersion()
Test the HTTP version passed. MUST be 1.1 or greater
public
verifyHTTPVersion(mixed $val) : bool
Parameters
- $val : mixed
Return values
boolverifyKey()
This function verifies the nonce is valid (64 big encoded, 16 bytes random string)
public
verifyKey(array<string|int, mixed> $keyHeader) : bool
Parameters
- $keyHeader : array<string|int, mixed>
Tags
Return values
boolverifyMethod()
Test the HTTP method. MUST be "GET"
public
verifyMethod(mixed $val) : bool
Parameters
- $val : mixed
Return values
boolverifyProtocol()
public
verifyProtocol(mixed $val) : mixed
Parameters
- $val : mixed
Tags
verifyRequestURI()
public
verifyRequestURI(mixed $val) : bool
Parameters
- $val : mixed
Return values
boolverifyUpgradeRequest()
Verify the Upgrade request to WebSockets.
public
verifyUpgradeRequest(array<string|int, mixed> $upgradeHeader) : bool
Parameters
- $upgradeHeader : array<string|int, mixed>
-
MUST equal "websocket"
Return values
boolverifyVersion()
Verify the version passed matches this RFC
public
verifyVersion(array<string|int, string> $versionHeader) : bool
Parameters
- $versionHeader : array<string|int, string>
-
MUST equal ["13"]