Menu

Reference / Http\WebSocket

HandshakeException

finalclass
final class HandshakeException extends \RuntimeException

Thrown by connect() when the WebSocket opening handshake does not complete.

Causes: an unsupported URL scheme (anything but ws:// or wss://), an empty host, CR/LF/NUL in the URL, a failed TCP/TLS connect, a response head over 16 KiB, a timeout (see Options::$connectTimeout), a non-101 status, a missing or wrong Sec-WebSocket-Accept, or a subprotocol or extension the client did not offer. The message names what disagreed.

See also: connect

View source