function $d11422b22cc93234$var$abortHandshake(socket, code, message, headers) {
    if (socket.writable) {
        message = message || $68DQ8$http.STATUS_CODES[code];
        headers = {
            Connection: 'close',
            'Content-Type': 'text/html',
            'Content-Length': Buffer.byteLength(message),
            ...headers
        };
        socket.write(`HTTP/1.1 ${code} ${$68DQ8$http.STATUS_CODES[code]}\r\n` + Object.keys(headers).map((h)=>`${h}: ${headers[h]}`
        ).join('\r\n') + '\r\n\r\n' + message);
    }
    socket.removeListener('error', $d11422b22cc93234$var$socketOnError);
    socket.destroy();
}
/**
 * Close the connection when preconditions are not fulfilled.
 *
 * @param {(net.Socket|tls.Socket)} socket The socket of the upgrade request
 * @param {Number} code The HTTP response status code
 * @param {String} [message] The HTTP response body
 * @param {Object} [headers] Additional HTTP response headers
 * @private
 */
Close the connection when preconditions are not fulfilled.
Close the connection when preconditions are not fulfilled .
function $d11422b22cc93234$var$abortHandshake(socket, code, message, headers) {
    if (socket.writable) {
        message = message || $68DQ8$http.STATUS_CODES[code];
        headers = {
            Connection: 'close',
            'Content-Type': 'text/html',
            'Content-Length': Buffer.byteLength(message),
            ...headers
        };
        socket.write(`HTTP/1.1 ${code} ${$68DQ8$http.STATUS_CODES[code]}\r\n` + Object.keys(headers).map((h)=>`${h}: ${headers[h]}`
        ).join('\r\n') + '\r\n\r\n' + message);
    }
    socket.removeListener('error', $d11422b22cc93234$var$socketOnError);
    socket.destroy();
}
function $d11422b22cc93234$var$abortHandshake ( socket , code , message , headers ) { if ( socket . writable ) { message = message || $68DQ8$http . STATUS_CODES [ code ] ; headers = { Connection : 'close' , 'Content-Type' : 'text/html' , 'Content-Length' : Buffer . byteLength ( message ) , ... headers } ; socket . write ( ` ${ code } ${ $68DQ8$http . STATUS_CODES [ code ] } \r \n ` + Object . keys ( headers ) . map ( ( h ) => ` ${ h } ${ headers [ h ] } ` ) . join ( '\r\n' ) + '\r\n\r\n' + message ) ; } socket . removeListener ( 'error' , $d11422b22cc93234$var$socketOnError ) ; socket . destroy ( ) ; }
Close the connection when preconditions are not fulfilled.
Close the connection when preconditions are not fulfilled .