function $bb7af8e8d7184be0$var$abortHandshake(websocket, stream, message) {
    websocket._readyState = $bb7af8e8d7184be0$var$WebSocket.CLOSING;
    const err = new Error(message);
    Error.captureStackTrace(err, $bb7af8e8d7184be0$var$abortHandshake);
    if (stream.setHeader) {
        stream.abort();
        if (stream.socket && !stream.socket.destroyed) //
        // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if
        // called after the request completed. See
        // https://github.com/websockets/ws/issues/1869.
        //
        stream.socket.destroy();
        stream.once('abort', websocket.emitClose.bind(websocket));
        websocket.emit('error', err);
    } else {
        stream.destroy(err);
        stream.once('error', websocket.emit.bind(websocket, 'error'));
        stream.once('close', websocket.emitClose.bind(websocket));
    }
}
/**
 * Abort the handshake and emit an error.
 *
 * @param {WebSocket} websocket The WebSocket instance
 * @param {(http.ClientRequest|net.Socket|tls.Socket)} stream The request to
 *     abort or the socket to destroy
 * @param {String} message The error message
 * @private
 */
Abort the handshake and emit an error.
@param {WebSocket} websocket The WebSocket instance
@param {} stream The request to
abort or the socket to destroy
@param {String} message The error message
@private
Abort the handshake and emit an error . @param { WebSocket } websocket The WebSocket instance @param {} stream The request to abort or the socket to destroy @param { String } message The error message @private
function $bb7af8e8d7184be0$var$abortHandshake(websocket, stream, message) {
    websocket._readyState = $bb7af8e8d7184be0$var$WebSocket.CLOSING;
    const err = new Error(message);
    Error.captureStackTrace(err, $bb7af8e8d7184be0$var$abortHandshake);
    if (stream.setHeader) {
        stream.abort();
        if (stream.socket && !stream.socket.destroyed) 
         On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if
         called after the request completed. See
         https:github.com/websockets/ws/issues/1869.
        stream.socket.destroy();
        stream.once('abort', websocket.emitClose.bind(websocket));
        websocket.emit('error', err);
    } else {
        stream.destroy(err);
        stream.once('error', websocket.emit.bind(websocket, 'error'));
        stream.once('close', websocket.emitClose.bind(websocket));
    }
}
function $bb7af8e8d7184be0$var$abortHandshake ( websocket , stream , message ) { websocket . _readyState = $bb7af8e8d7184be0$var$WebSocket . CLOSING ; const err = new Error ( message ) ; Error . captureStackTrace ( err , $bb7af8e8d7184be0$var$abortHandshake ) ; if ( stream . setHeader ) { stream . abort ( ) ; if ( stream . socket && ! stream . socket . destroyed ) stream . socket . destroy ( ) ; stream . once ( 'abort' , websocket . emitClose . bind ( websocket ) ) ; websocket . emit ( 'error' , err ) ; } else { stream . destroy ( err ) ; stream . once ( 'error' , websocket . emit . bind ( websocket , 'error' ) ) ; stream . once ( 'close' , websocket . emitClose . bind ( websocket ) ) ; } }
Abort the handshake and emit an error.
Abort the handshake and emit an error .
// // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if // called after the request completed. See // https://github.com/websockets/ws/issues/1869. //