-
Notifications
You must be signed in to change notification settings - Fork 186
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
Express HTTP2 #220
Comments
Same error here. ([email protected], [email protected], [email protected]) |
I just figured out what's happening (Digging through the code to find this took 2-3 hrs). The fault is actually express'. If you look at express/lib/middleware/init.js on lines 28 and 29 they are replacing the prototypes of the request and response. I don't know why but that is causing the http2 prototypes to get destroyed which is causing that error. If you fix the request's prototype you actually see similar issues with the response object. |
More Info. That behavior has been there since express 3.0.0... Still digging into why |
It appears that there has been some discussion going on in the express side |
adding express.request.__proto__ = http2.IncomingMessage.prototype;
express.response.__proto__ = http2.ServerResponse.prototype; per one of the express post suggestions seems to work around the issue for now |
As the above code does work nicely, it does stop HTTP/1.x requests from working if the http server is used with express too (since the prototype is now changed to http2's). |
I will try @waterfoul and @unchosen solutions when I have some time this week. Thank you guys |
Add workaround for http/1 fallback. Reference: molnarg/node-http2#220 Add logging support
Hi,
sorry for opening another issue on this but the past one is locked and hasnt been updated for a year. was there ever a resolution found for Express and HTTP2 module?
I'm still getting the error mentioned in previous comments.
The text was updated successfully, but these errors were encountered: