diff --git a/System/Snowflake.php b/System/Snowflake.php index 892f8630..fe93510e 100644 --- a/System/Snowflake.php +++ b/System/Snowflake.php @@ -12,6 +12,7 @@ use Snowflake\Di\Container; use Snowflake\Exception\NotFindClassException; use Snowflake\Process\Process; use Swoole\Coroutine; +use Swoole\WebSocket\Server; class Snowflake { @@ -195,6 +196,16 @@ class Snowflake } + /** + * @return Server|\Swoole\Http\Server + * @throws + */ + public static function getWebSocket() + { + return static::app()->get('server')->getServer(); + } + + /** * @param string $class * @param array $params