Свойство | Тип | Описание | |
---|---|---|---|
$routes |
Свойство | Тип | Описание | |
---|---|---|---|
$_routeCounter | integer | ||
$_server | Ratchet\Server\IoServer | ||
$httpHost | string | The Host passed in construct used for same origin policy. | |
$port | * The port the socket is listening |
Метод | Описание | |
---|---|---|
__construct ( string $httpHost = 'localhost', integer $port = 8080, string $address = '127.0.0.1', React\EventLoop\LoopInterface $loop = null ) | ||
route ( string $path, Ratchet\ComponentInterface $controller, array $allowedOrigins = [], string $httpHost = null ) : Ratchet\ComponentInterface | Ratchet\WebSocket\WsServer | Add an endpoint/application to the server. | |
run ( ) | Run the server by entering the event loop. |
public __construct ( string $httpHost = 'localhost', integer $port = 8080, string $address = '127.0.0.1', React\EventLoop\LoopInterface $loop = null ) | ||
$httpHost | string | HTTP hostname clients intend to connect to. MUST match JS `new WebSocket('ws://$httpHost');` |
$port | integer | Port to listen on. If 80, assuming production, Flash on 843 otherwise expecting Flash to be proxied through 8843 |
$address | string | IP address to bind to. Default is localhost/proxy only. '0.0.0.0' for any machine |
$loop | React\EventLoop\LoopInterface | Specific React\EventLoop to bind the application to. null will create one for you |
public route ( string $path, Ratchet\ComponentInterface $controller, array $allowedOrigins = [], string $httpHost = null ) : Ratchet\ComponentInterface | Ratchet\WebSocket\WsServer | ||
$path | string | The URI the client will connect to |
$controller | Ratchet\ComponentInterface | Your application to server for the route. If not specified, assumed to be for a WebSocket |
$allowedOrigins | array | An array of hosts allowed to connect (same host by default), ['*'] for any |
$httpHost | string | Override the $httpHost variable provided in the __construct |
Результат | Ratchet\ComponentInterface | Ratchet\WebSocket\WsServer |
protected IoServer,Ratchet\Server $_server | ||
Результат | Ratchet\Server\IoServer |
protected string $httpHost | ||
Результат | string |