Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Use port on websockets.php as default(6001 as fallback) #950

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Console/Commands/StartServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class StartServer extends Command
*/
protected $signature = 'websockets:serve
{--host=0.0.0.0}
{--port=6001}
{--port=}
{--disable-statistics : Disable the statistics tracking.}
{--statistics-interval= : The amount of seconds to tick between statistics saving.}
{--debug : Forces the loggers to be enabled and thereby overriding the APP_DEBUG setting.}
Expand Down Expand Up @@ -254,7 +254,8 @@ protected function configureConnectionLogger()
*/
protected function startServer()
{
$this->info("Starting the WebSocket server on port {$this->option('port')}...");
$port = $this->option('port') ?: config('websockets.dashboard.port', 6001);
$this->info("Starting the WebSocket server on port {$port}...");

$this->buildServer();

Expand All @@ -269,7 +270,7 @@ protected function startServer()
protected function buildServer()
{
$this->server = new ServerFactory(
$this->option('host'), $this->option('port')
$this->option('host'), $this->option('port') ?: config('websockets.dashboard.port', 6001)
);

if ($loop = $this->option('loop')) {
Expand Down