diff --git a/src/Application.php b/src/Application.php index d84fa83d..92a9dc92 100644 --- a/src/Application.php +++ b/src/Application.php @@ -55,7 +55,7 @@ public function __construct( // Frontend $feConfig = $this->container->get(FrontendConfig::class); - $feSeparated = $withFrontend && !\in_array( + $feSeparated = !\in_array( $feConfig->port, \array_map(static fn(SocketServer $item): ?int => $item->type === 'tcp' ? $item->port : null, $map, ), true, @@ -80,7 +80,8 @@ public function __construct( ]); $this->processors[] = $inspector; - if (!$feSeparated) { + + if ($withFrontend && !$feSeparated) { $inspectorWithFrontend = $container->make(Inspector::class, [ new Traffic\Dispatcher\VarDumper(), new Traffic\Dispatcher\Http( @@ -103,7 +104,7 @@ public function __construct( $this->configureFileObserver(); foreach ($map as $config) { - !$feSeparated && $config->type === 'tcp' && $config->port === $feConfig->port + $withFrontend && !$feSeparated && $config->type === 'tcp' && $config->port === $feConfig->port ? $this->prepareServerFiber($config, $inspectorWithFrontend, $this->logger) : $this->prepareServerFiber($config, $inspector, $this->logger); } diff --git a/src/Command/Run.php b/src/Command/Run.php index 6e18b28c..91bb1adb 100644 --- a/src/Command/Run.php +++ b/src/Command/Run.php @@ -63,7 +63,7 @@ public function getServers(Container $container): array $config = $container->get(TcpPorts::class); $servers = []; - $ports = $config->ports ?: [9912]; + $ports = $config->ports ?: [1025, 8000, 9912, 9913]; /** @var scalar $port */ foreach ($ports as $port) { \is_numeric($port) or throw new \InvalidArgumentException(