public function attachViaWebSocket(?string $id,
                                       string $detachKeys = null,
                                       bool $logs = false,
                                       bool $stream = false,
                                       bool $stdin = false,
                                       bool $stdout = false,
                                       bool $stderr = false)
    {
        $url = self::$base_url.'/'.($id ?? $this->container_id).'/attach/ws?'.http_build_query(
            compact('detachKeys', 'logs', 'stream', 'stdin', 'stdout', 'stderr'));

        return self::$curl->get($url);
    }