-
-
Notifications
You must be signed in to change notification settings - Fork 16.4k
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
Support for module http2? #2761
Comments
I have just tested with latest release alpha (5.0.0-alpha.2) and the problem continues:
traces:
|
Hi! o answer your question, yes, it is a known issue, and no, has not yet been addressed. We have a link back to that referenced
The 5.0 alpha 2 does not work because it has not been addressed yet. It is not a simple fix at all, and any help you want to provide toward this as part of a PR is much appreciated! |
In addition, if all you want to do is replicate the Express routing with /*jslint node: true*/
"use strict";
var finalhandler = require('finalhandler');
var fs = require('fs');
var http2 = require('http2');
var Router = require('router');
var router = new Router();
router.get('/', function (req, res) {
console.log(req.headers);
res.setHeader('Content-type', 'text/html');
return res.end('<h1>Hello, Secure World!</h1>');
});
var options = {
key: fs.readFileSync('./certificate/localhost.key'),
cert: fs.readFileSync('./certificate/localhost.crt')
};
var port = process.env.VCAP_APP_PORT || 8080;
http2.createServer(options, app).listen(port);
function app(req, res) {
router(req, res, finalhandler(req, res));
} |
Hi @dougwilson, if you provide some technical documentation to check that classes, I could help you to begin fixing this issue. Tomorrow, I will test the alternative. |
Hi @jabrena , I'm not sure what kind of technical documentation you are looking for. All Express documentation is located at http://expressjs.com/ and anything technical is gathered from reading the JavaScript source code of Express. |
No problem, will try to check this part:
it is a clue from a comment in: Besides, I will compare current router with the router that runs with http2 Juan Antonio |
@jabrena , @dougwilson why not https://github.com/indutny/node-spdy?
|
AFAIK node-spdy already works with Express 4 |
👍 |
Pretty interesting!!! |
I can confirm node-spdy works fine, I'm using it. It doesn't however let you use HTTP/2 push promises very easily with Express. I made an issue about this at #2781. |
I think having http2 out of the box is perhaps a little out of scope of express itself? |
It may be, but I interpret this issue as the fact that it's impossible to even use the |
The problem to me is not that express is not compatible with the |
Hi @ronkorving, perhaps open a new issue in regards to that problem? I don't want to loose sight on the issue brought up in the original post on the issue, which is specifically about working with |
You mean like #2781 ? :) |
Ah, yep :) But I don't know anything about |
No problem 👍 |
@dougwilson - I went down your path of using router module and ran into issues with not being able to use res.sendFile anymore. I ended up extracting all the sendFile logic and reworking it as a thunk that works just like serveStatic (supports all sendFile options). I published it as serve-file module, may come in handy to anyone that ran into the same issues as me. I tested it on http2 / spdy with router and had no issues: import serveFile from 'serve-file'
app.use('/my-file.txt', serveFile('path/to/my-file.txt')) |
I'm quite curious if initialising an express application as follows would be enough to resolve the problems. It seems to be enough to get a very simple application working (on express 5.0 branch): var express = require('express');
var http2 = require('http2');
express.request.__proto__ = http2.IncomingMessage.prototype;
express.response.__proto__ = http2.ServerResponse.prototype;
var app = express();
... |
This comment was marked as outdated.
This comment was marked as outdated.
@tunniclm, your work looks promising. Any reason why you're not submitting it as a pull request towards the official repository? |
For anyone saying just use spdy, HTTP/2 is an actual standard now. SPDY is not. On top of that IMO supporting the actual native |
as @nwgh actually mentioned in molnarg/node-http2#100 on Aug 9, 2016 already:
So the SPDY package is no longer maintained, and due to a bug in the Is there any update on the progress about this? It'd be a bummer if Express 5 would not provide any HTTP/2 support! Thanks. |
Has anybody got anything to push to fix http/2 issues? log in #4112 for 4.17.1/5.0/5.x... we tried pillerjs/router as a fix but still leaves is in a broken state. many modules and process explicitly depend on express being available and have only managed to work through a fraction of them to remove express dependencies. |
fyi, the I was just able to start an HTTP/2 server using spdy and express on Node |
Some one has created a bridge to make this work. Contributors/Maintaners here can check it and update it if needed, |
node-spdy does not work for static files on node >=15; link to issue. |
Hi, I would like to know if Express 5.0 will have support for http2:
https://github.com/molnarg/node-http2
I was reading a bit and I noticed that exist a problem with http2 module:
molnarg/node-http2#100
I have tested in local and the problem continues:
https://github.com/jabrena/CloudFoundryLab/blob/master/Node_HelloWorld_http2_express/index.js
It this issue in the roadmap?
Does exist another alternative to run a express application with http2?
Many thanks in advance.
Juan Antonio
The text was updated successfully, but these errors were encountered: