Documentation

ServerNegotiator
in package
implements NegotiatorInterface

The latest version of the WebSocket protocol

Tags
todo

Unicode: return mb_convert_encoding(pack("N",$u), mb_internal_encoding(), 'UCS-4BE');

Table of Contents

Interfaces

NegotiatorInterface
A standard interface for interacting with the various version of the WebSocket protocol

Properties

$_strictSubProtocols  : bool
$_supportedSubProtocols  : array<string|int, mixed>
$enablePerMessageDeflate  : bool
$responseFactory  : ResponseFactoryInterface
$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()  : void
If enabled and support for a subprotocol has been added handshake will not upgrade if a match between request and supported subprotocols
setSupportedSubProtocols()  : void
Add supported protocols. If the request has any matching the response will include one

Properties

$_supportedSubProtocols

private array<string|int, mixed> $_supportedSubProtocols = []

Methods

getVersionNumber()

Although the version has a name associated with it the integer returned is the proper identification

public getVersionNumber() : int
Return values
int

setStrictSubProtocolCheck()

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) : void
Parameters
$enable : bool
Tags
todo

Consider extending this interface and moving this there. The spec does say the server can fail for this reason, but it is not a requirement. This is an implementation detail.

setSupportedSubProtocols()

Add supported protocols. If the request has any matching the response will include one

public setSupportedSubProtocols(array<string|int, mixed> $protocols) : void
Parameters
$protocols : array<string|int, mixed>
On this page

Search results