src/Leevel/Protocol/WebsocketServer.php
public function onOpen(SwooleWebsocketServer $server, SwooleHttpRequest $swooleRequest): void
    {
        $this->log(
            sprintf('Server: handshake success with fd %s', $swooleRequest->fd)
        );

        $this->setClientPathInfo($swooleRequest->fd, $swooleRequest->server['path_info']);

        $request = $this->normalizeRequest($swooleRequest);
        $request->setPathInfo($this->normalizePathInfo($request->getPathInfo(), self::OPEN));

        $this->setPreRequestMatched($request, [$server, $request, $swooleRequest->fd]);

        $response = $this->dispatchRouter($request);
    }
public function onOpen(SwooleWebsocketServer $server, SwooleHttpRequest $swooleRequest): void
    {
        $this->log(
            sprintf('Server: handshake success with fd %s', $swooleRequest->fd)
        );

        $this->setClientPathInfo($swooleRequest->fd, $swooleRequest->server['path_info']);

        $request = $this->normalizeRequest($swooleRequest);
        $request->setPathInfo($this->normalizePathInfo($request->getPathInfo(), self::OPEN));

        $this->setPreRequestMatched($request, [$server, $request, $swooleRequest->fd]);

        $response = $this->dispatchRouter($request);
    }
WebSocket 客户端与服务器建立连接并完成握手后.

@param \Swoole\Websocket\Server $server
@param \Swoole\Http\Request     $swooleRequest

@see https://wiki.swoole.com/wiki/page/401.html