diff --git a/src/Sender.php b/src/Sender.php index 1332a9f..7bd3f2b 100644 --- a/src/Sender.php +++ b/src/Sender.php @@ -17,6 +17,7 @@ use Hyperf\Engine\Contract\WebSocket\FrameInterface; use Hyperf\Engine\WebSocket\Response as WsResponse; use Hyperf\Server\CoroutineServer; +use Hyperf\Server\SwowServer; use Hyperf\WebSocketServer\Exception\InvalidMethodException; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; @@ -47,7 +48,10 @@ public function __construct(protected ContainerInterface $container) { $this->logger = $container->get(StdoutLoggerInterface::class); if ($config = $container->get(ConfigInterface::class)) { - $this->isCoroutineServer = $config->get('server.type') === CoroutineServer::class; + $this->isCoroutineServer = in_array($config->get('server.type'), [ + CoroutineServer::class, + SwowServer::class, + ]); } }