ServerNegotiator
in package
implements
NegotiatorInterface
The latest version of the WebSocket protocol
Tags
Table of Contents
Interfaces
- NegotiatorInterface
- A standard interface for interacting with the various version of the WebSocket protocol
Properties
- $_strictSubProtocols : mixed
- $_supportedSubProtocols : mixed
- $enablePerMessageDeflate : mixed
- $verifier : RequestVerifier
Methods
- __construct() : mixed
- getVersionNumber() : int
- Although the version has a name associated with it the integer returned is the proper identification
- handshake() : ResponseInterface
- Perform the handshake and return the response headers
- isProtocol() : bool
- Given an HTTP header, determine if this version should handle the protocol
- setStrictSubProtocolCheck() : mixed
- If enabled and support for a subprotocol has been added handshake will not upgrade if a match between request and supported subprotocols
- setSupportedSubProtocols() : mixed
- Add supported protocols. If the request has any matching the response will include one
Properties
$_strictSubProtocols
private
mixed
$_strictSubProtocols
= false
$_supportedSubProtocols
private
mixed
$_supportedSubProtocols
= []
$enablePerMessageDeflate
private
mixed
$enablePerMessageDeflate
= false
$verifier
private
RequestVerifier
$verifier
Methods
__construct()
public
__construct(RequestVerifier $requestVerifier[, mixed $enablePerMessageDeflate = false ]) : mixed
Parameters
- $requestVerifier : RequestVerifier
- $enablePerMessageDeflate : mixed = false
getVersionNumber()
Although the version has a name associated with it the integer returned is the proper identification
public
getVersionNumber() : int
Return values
inthandshake()
Perform the handshake and return the response headers
public
handshake(RequestInterface $request) : ResponseInterface
Parameters
- $request : RequestInterface
Return values
ResponseInterfaceisProtocol()
Given an HTTP header, determine if this version should handle the protocol
public
isProtocol(RequestInterface $request) : bool
Parameters
- $request : RequestInterface
Return values
boolsetStrictSubProtocolCheck()
If enabled and support for a subprotocol has been added handshake will not upgrade if a match between request and supported subprotocols
public
setStrictSubProtocolCheck(bool $enable) : mixed
Parameters
- $enable : bool
Tags
setSupportedSubProtocols()
Add supported protocols. If the request has any matching the response will include one
public
setSupportedSubProtocols(array<string|int, mixed> $protocols) : mixed
Parameters
- $protocols : array<string|int, mixed>