constructor({
        port, useSsl, sslKey, sslCrt,
    }) {
        this.port = port;
        this.useSsl = useSsl;

        this.app = express();

        // Parse an HTML body into a string
        this.app.use(bodyParser.text({ type: 'text/*', limit: '10MB' }));

        this.app.all('/hello-world', this.allHelloWorld.bind(this));
        this.app.all('/echo-request-info', this.allEchoRequestInfo.bind(this));
        this.app.all('/echo-raw-headers', this.allEchoRawHeaders.bind(this));
        this.app.all('/echo-payload', this.allEchoPayload.bind(this));
        this.app.get('/redirect-to-hello-world', this.getRedirectToHelloWorld.bind(this));
        this.app.get('/get-1m-a-chars-together', this.get1MACharsTogether.bind(this));
        this.app.get('/get-1m-a-chars-streamed', this.get1MACharsStreamed.bind(this));
        this.app.get('/basic-auth', this.getBasicAuth.bind(this));
        this.app.get('/get-non-standard-headers', this.getNonStandardHeaders.bind(this));
        this.app.get('/get-invalid-status-code', this.getInvalidStatusCode.bind(this));
        this.app.get('/get-repeating-headers', this.getRepeatingHeaders.bind(this));

        this.app.all('*', this.handleHttpRequest.bind(this));

        if (useSsl) {
            this.httpServer = https.createServer({ key: sslKey, cert: sslCrt }, this.app);
        } else {
            this.httpServer = http.createServer(this.app);
        }

        // Web socket server for upgraded HTTP connections
        this.wsUpgServer = new WebSocket.Server({ server: this.httpServer });
        this.wsUpgServer.on('connection', this.onWsConnection.bind(this));
    }
A HTTP server used for testing. It supports HTTPS and web sockets.