upgrade(context) {
        // Do not allow upgrades if request is already completed
        if (this.completed) return;

        // Ensure a upgrade_socket exists before upgrading ensuring only upgrade handler requests are handled
        if (this._upgrade_socket == null)
            this.throw(
                new Error(
                    'HyperExpress: You cannot upgrade a request that does not come from an upgrade handler. No upgrade socket was found.'
                )
            );

        // Resume the request in case it was paused
        this._wrapped_request.resume();

        // Cork the response if it has not been corked yet for when this was handled asynchonously
        if (this._cork && !this._corked) {
            this._corked = true;
            return this.atomic(() => this.upgrade(context));
        }

        // Call uWS.Response.upgrade() method with user data, protocol headers and uWS upgrade socket
        const headers = this._wrapped_request.headers;
        this._raw_response.upgrade(
            {
                context,
            },
            headers['sec-websocket-key'],
            headers['sec-websocket-protocol'],
            headers['sec-websocket-extensions'],
            this._upgrade_socket
        );

        // Mark request as complete so no more operations can be performed
        this.completed = true;

        // Decrement the pending request count
        this.route.app._resolve_pending_request();
    }
This method is used to upgrade an incoming upgrade HTTP request to a Websocket connection.
@param {Object=} context Store information about the websocket connection