-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Using express with the new http2 module #14672
Comments
Ping @jasnell - this is a first time contributor trying http2. |
Playing with it a little more - I got it to work, but I had to expose Http2ServerRequest/Response, I think it might be a good idea to expose it in general in the new http2 module. |
In order for express (and possibly other libraries) to get and use the Http2ServerRequest/Response - expose them in the http2 exports. Same as is done in http module. This is only a suggestion - not sure if this is the way to go, but with this it allows for express to run with http2 server immediately. ref: expressjs/express#3390 fixes: nodejs#14672 Fix Lint
In order for express (and possibly other libraries) to get and use the Http2ServerRequest/Response - expose them in the http2 exports. Same as is done in http module. PR-URL: nodejs/node#14690 Ref: expressjs/express#3390 Fixes: nodejs/node#14672 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
There is a matching PR to express, that I am waiting for go / no go (still
needs refactoring etc.) but with it - http2 works including push.
…On Thu, Aug 31, 2017 at 5:57 AM, MongoExpUser ***@***.***> wrote:
So, what is the solution to this problem as of today?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14672 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AOq55S76pwgWv4VtE_rB5m5TjXquGeFYks5sdiEugaJpZM4OvuHm>
.
--
*Pini Houri*
Web Developer
Mobile: +972-525402819
Email: [email protected]
[image: cid:[email protected]]
<http://www.dynamicyield.com/?utm_source=signature&utm_medium=email&utm_campaign=logo>
|
@PiniH any ETA on when we can expect Express to work with http2? |
Wrote to Douglass on the corresponding express PR will update once I get a word from him.
On Thu, Aug 31, 2017 at 10:30 AM +0300, "Benjamin Gruenbaum" <[email protected]> wrote:
@PiniH any ETA on when we can expect Express to work with Http2?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
(unrelated: I have removed excess spacing created by replying via email without altering the content in PiniH's post) |
@PiniH, |
Has the change to expose the prototype been released yet? |
Not yet. It has landed tho so it should be soon |
Nice :) also did anything ever happen with the two items at #14690 (comment) ? |
I'll look at the statusMessage setter. The path one is likely better for express to handle but if you have an idea on how we can handle it on our side then ++ |
Thanks, James :) I believe @PiniH is going to look into how / if Express.js can handle the req.path on it's side, so it may be possible. |
Awesome. I'm excited. Let me know if there's anything else needed for this. |
In order for express (and possibly other libraries) to get and use the Http2ServerRequest/Response - expose them in the http2 exports. Same as is done in http module. PR-URL: #14690 Ref: expressjs/express#3390 Fixes: #14672 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
In order for express (and possibly other libraries) to get and use the Http2ServerRequest/Response - expose them in the http2 exports. Same as is done in http module. PR-URL: #14690 Ref: expressjs/express#3390 Fixes: #14672 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Any chance of getting an example of how you got it working? I tired...
|
@PiniH (or anyone else), can you please explain your solution? I'm getting the same error now and I don't see how you were able to get it working.
My simple server: // index.js
const port = 3000
const express = require('express')
const http2 = require('http2')
const app = express();
app.get('*', (req, res) => {
res.status(200).json({message: 'ok'})
})
const server = http2.createServer(app)
server.listen(port)
server.on('listening', () => console.log(`Listening on port: ${port}.`)) I'm using Here's what I get when I run the server locally and hit it with cURL: $ curl --http2-prior-knowledge http://localhost:3000
curl: (56) Recv failure: Connection reset by peer and on the server I see the error reported at the top of this issue:
I get the same error when I deploy it. It successfully navigates the TLS handshake on the reverse proxy, then it hits my server and crashes with the same error. If anyone can help me get unstuck here I would be very grateful. Thanks for all you do. |
Whats up with this, pushed to express then whats the corresponding issue there ? /T |
Hi @jrgleason , any news about this problem?
|
Crossing fingers, with node 14.15.1 and koa 2.13.1 my application seems to work with native http2 without problems. |
Testing node's new http2 native module I couldn't get express to serve requests over http2,
Using node master build with --expose-http2 (v9.0.0-pre macOS) flag:
When requesting /express the server crashed with the following error:
Opened an issue for express as well: expressjs/express#3388
@benjamingr
The text was updated successfully, but these errors were encountered: