Skip to content

Client

Class  ·  Sharkord\HTTP\Client

Class HTTPClient

Responsible for handling HTTP communication with the Sharkord API, primarily the initial authentication to retrieve connection tokens.

Client constructor.

Parameters

ParameterTypeDescription
$configarrayConfiguration array containing ‘host’, ‘identity’, and ‘password’.
$loopLoopInterfaceThe ReactPHP event loop instance.
$loggerLoggerInterfaceThe PSR-3 logger instance.

Authenticates with the server via HTTP to retrieve a WebSocket token.

Returns \PromiseInterface — Resolves with the authentication token (string), or rejects on failure.