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

support for http2 #77

Closed
890f2151c2be69c51db72017546d00fd opened this issue Mar 30, 2016 · 6 comments
Closed

support for http2 #77

890f2151c2be69c51db72017546d00fd opened this issue Mar 30, 2016 · 6 comments
Assignees

Comments

@890f2151c2be69c51db72017546d00fd

it would be nice use this module with http2.

@dougwilson
Copy link
Contributor

Hi! Does it not work? What issue does it have? Can you provide an example of how you are trying to use it?

We need a lot more information to be able to do anything :)

@890f2151c2be69c51db72017546d00fd
Copy link
Author

Hi

it doesnt work.
i try it with connect because express as far as i know doesnt support http2 yet.

var connect = require('connect');
var http2 = require('http2');
var fs = require('fs');

var app = connect();

// gzip/deflate outgoing responses
var compression = require('compression');
app.use(compression());

// respond to all requests
app.use(function(req, res){
  res.end('Hello from Connect!\n');
});


var options = {
  key: fs.readFileSync('./localhost.key'),
  cert: fs.readFileSync('./localhost.crt'),
  passphrase: 'pass'
};

http2.createServer(options, app).listen(3000);

it ends with error this._implicitHeader is not a function

@dougwilson
Copy link
Contributor

AFAIK it should work, because the http2 module has that method. Can you provide the full stack trace for that error and what version of the "http2" module you are using is?

@890f2151c2be69c51db72017546d00fd
Copy link
Author

here are console and debug log https://justpaste.it/srlc
"compression": "1.6.1",
"connect": "3.4.1",
"http2": "3.3.2",

@dougwilson dougwilson self-assigned this Mar 30, 2016
@dougwilson
Copy link
Contributor

Oh, haha, I see now. They spelled it with a plural, which does not conform to compatibility with Node.js code: https://github.com/molnarg/node-http2/blob/master/lib/http.js#L738

If you are interested in getting compatibility, I'd suggest making a pull request to http2 to add an alias to the singular form of the method name to match Node.js HTTP core.

@890f2151c2be69c51db72017546d00fd
Copy link
Author

thank you for your time/help
pull request in http2 created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants