"use strict"; const net = require('net'); const assert = require('assert'); let client = net.createConnection({host:"localhost", port: 61613}, () => { client.write("GET /xtomp HTTP/1.1\n" + "host: localhost\n" + "connection: upgrade\n" + "upgrade: websocket\n" + "origin: http://localhost\n" + "Sec-WebSocket-Version: 13\n" + "Sec-WebSocket-Protocol: stomp\n\n"); //"Sec-WebSocket-Key: lCMmdU5K24A2vDkOYrqRLQ==\n\n"); }); client.on('data', (data) => { let status = data.toString().split('\n')[0].trim(); assert.equal(status, "HTTP/1.1 500 Server Error"); client.end(); process.exit(0); });