-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With http2 "socket hang up" #617
Comments
Someone suggested to use |
I'm using fastify and ran into the same problem when I turned on http2. I then turned it off but kept https configured and that worked. At this point I'm thinking that the issue is http2, not https itself. The only difference from when I ran the tests only with http is that I used the environment variable I also used the |
Unfortunately, defining |
Dear @lddubeau, |
Given the date of this issue, it should be Nevertheless, this http2 feature has been incorporated into Based on your code, I would reckon it would be something like: const request = require('supertest');
const options = {
key: fs.readFileSync(path.join(__dirname, "cert", "privkey.pem")),
cert: fs.readFileSync(path.join(__dirname, "cert", "cert.pem"))
};
const app = function(req, res) {
res.end('hey');
};
const server = http2.createSecureServer(options, app); // either
request(server) // pass in your http2 server
.get('/')
.http2() // https://visionmedia.github.io/superagent/#using-http/2
.disableTLSCerts(); // https://visionmedia.github.io/superagent/#tls-options
// or
request(server) // pass in your http2 server
.get('/')
.http2() // https://visionmedia.github.io/superagent/#using-http/2
.trustLocalhost(); // https://visionmedia.github.io/superagent/#testing-on-localhost |
Closed via #793 and released in v6.3.0 |
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:Any ideas? Everything runs smoothly if I use http and createServer()
Thanks!
mario
The text was updated successfully, but these errors were encountered: