Skip to content
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

Use of http2 API from master node.core in express application #3476

Open
uttampawar opened this issue Nov 9, 2017 · 8 comments
Open

Use of http2 API from master node.core in express application #3476

uttampawar opened this issue Nov 9, 2017 · 8 comments

Comments

@uttampawar
Copy link

I'm trying to port https://github.com/Node-DC/Node-DC-EIS application (currently in node.js benchmarking) to use http2 api from Node.js core to track and understand performance impact of new api. I know how "spdy" module is used in express app, is this going to be similar? Or is there any guideline or migration document/readme available? What branch of express I should use for my work? This can also help test http2 support in express if that is something is important to expressjs project.

@dougwilson
Copy link
Contributor

PR #3390 is the current work for http2 support, if that helps.

@uttampawar uttampawar changed the title Use of http2 API from master node.core in express? Use of http2 API from master node.core in express application Nov 9, 2017
@uttampawar
Copy link
Author

uttampawar commented Nov 9, 2017

@dougwilson Thanks and yes, I'm following all the discussion on that thread. Since I'm newbie at JS development just wanted to get clarification about kind of changes I need to make to dc-eis application. For e.g. in this application we have following,

var express = require('express');
var app_host='localhost';
var app_port=9000;
var app = express();
var server = app.listen({ host: app_host, port: port});

I understand that above code (app.listen line) needs to change with something line,
var http2 = require('http2');
const server = http2.createSecureServer({
key: fs.readFileSync('localhost-privkey.pem'),
cert: fs.readFileSync('localhost-cert.pem')
}, app).listen(app_port, app_host);

But is that it?

@dougwilson
Copy link
Contributor

Gotcha, sorry. Yes, that would work if you are using the code from that PR branch (not master). You can also check out the example app in that PR for a complete example: https://github.com/phouri/express/blob/2ac75f2ffa75bafc05e53b90d3bde8b02b6028ce/examples/http2/index.js

@uttampawar
Copy link
Author

@dougwilson Thanks for the example PR.

@atdiff
Copy link

atdiff commented Apr 4, 2018

@dougwilson, any updates on when the PR will be released and the http2 functionality available?

@dougwilson
Copy link
Contributor

Someone needs to complete that PR. I can do it too, but no one ever gave me the code they used so I could finish it. See my request in #3390 (comment)

If you have an idea for what my next step is, please let me know 👍

@atdiff
Copy link

atdiff commented Apr 4, 2018

@dougwilson Thanks for the update. No worries. Just curious and anxious to use it. :)

@Abourass
Copy link

Abourass commented Nov 6, 2018

@dougwilson - The thread you linked, you just closed. (That's how I found it). I think the following link is correct?

For those looking, here's the new PR under which to discuss this topic - #3730

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

No branches or pull requests

4 participants