protected function prepareWebsocket()
    {
        $config = $this->container->make('config');
        $isWebsocket = $config->get('swoole_http.websocket.enabled');
        $parser = $config->get('swoole_websocket.parser');

        if ($isWebsocket) {
            $this->events = array_merge($this->events ?? [], $this->wsEvents);
            $this->isServerWebsocket = true;
            $this->setPayloadParser(new $parser);
        }
    }