Skip to content

With http2 "socket hang up" #617

@crystalfp

Description

@crystalfp

I'm using supertest on Windows 10 and node 12.14.1 with great satisfaction.
However, if I switch my server to http2 all tests fail. They prints only socket hang up and nothing more. My server is Koa and tests are written with typescript. Here is an excerpt:

import http2 from "http2";

const app = new Koa();
const options = {
	key:  fs.readFileSync(path.join(__dirname, "cert", "privkey.pem")),
	cert: fs.readFileSync(path.join(__dirname, "cert", "cert.pem"))
};

const server = http2
			.createSecureServer(options, app.callback())
			.once("error", handleServerErrors)
			.listen(3111, () => runApp("https"));

request = supertest(server);

Any ideas? Everything runs smoothly if I use http and createServer()

Thanks!
mario

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions