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  : 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

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

Consider extending this interface and moving this there. The spec does says 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) : mixed
Parameters
$protocols : array<string|int, mixed>

        
On this page

Search results