Skip to content

NODE 1428: Adapt express and koa to use HTTP/2 #136

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

Merged
merged 2 commits into from
Apr 30, 2021

Conversation

jcolekaplan
Copy link
Contributor

There was some confusion because the ticket specifies:

Express-test-bench should be adapted to use the standard library http2
Koa-test-bench should be adapted to use the spdy library

but according to some of the documentation included in that same ticket: https://www.perimeterx.com/tech-blog/2019/http2/

We need to have couple of changes if we want to apply HTTP/2 on our Express server. We can’t use the native HTTP/2 library directly, so we will use the spdy library.

So I'm assuming it was a typo and that Koa should be adapted to use the native HTTP/2 library and Express should use Spdy. It doesn't look like Express will be compatible with the native library any time soon: expressjs/express#3388

@meandthemoon meandthemoon self-assigned this Apr 23, 2021
Copy link
Contributor

@meandthemoon meandthemoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, but a few minor things.

express/index.js Outdated
if (isHttps) {
server = https.createServer(options, app);
} else if (isHttp2) {
server = http2.createServer(options, app);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want http2.createSecureServer(options, app) here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like spdy has a createSecureServer method: https://github.com/spdy-http2/node-spdy

Copy link
Contributor

@meandthemoon meandthemoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jcolekaplan jcolekaplan merged commit 7105bce into main Apr 30, 2021
@tough-griff tough-griff deleted the NODE-1428-adapt-apps-for-http2 branch August 13, 2021 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants