Client
Class · Sharkord\HTTP\Client
Class HTTPClient
Responsible for handling HTTP communication with the Sharkord API, primarily the initial authentication to retrieve connection tokens.
Methods
Section titled “Methods”__construct()
Section titled “__construct()”Client constructor.
Parameters
| Parameter | Type | Description |
|---|---|---|
$config | array | Configuration array containing ‘host’, ‘identity’, and ‘password’. |
$loop | LoopInterface | The ReactPHP event loop instance. |
$logger | LoggerInterface | The PSR-3 logger instance. |
authenticate()
Section titled “authenticate()”Authenticates with the server via HTTP to retrieve a WebSocket token.
Returns \PromiseInterface — Resolves with the authentication token (string), or rejects on failure.