You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, compression does not work with http2. I guess, when using http2, doing chunked transfer-enconding is not necessary, so I'm not sure if http2 support is in the scope of this project.
The following code tries to use http2 with compression and throws a TypeError: this._implicitHeader is not a function.
// tested with:
// "dependencies": {
// "compression": "^1.6.1",
// "connect": "^3.4.1",
// "http2": "^3.3.2"
// }
var connect = require('connect');
var http2 = require('http2');
var compression = require('compression');
var app = connect();
app.use(compression());
app.use(function(req, res, next){
for (var i = 1000; i > 0; --i) {
res.write('test');
}
res.end();
});
var options = {
key: '-----BEGIN PRIVATE KEY-----\nMIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALCFSC+jZCN4JHCj\nI/dXL5ZviSYjc4vvOlFBvA4lYu6ReNqICUw1p9ULp/xVrWR7yEtzq+yB+NMrTD1T\nxO4VYKQrDqrYjnshCSo+kbcvyyOh3gO6nZjdVGj50OdrTNof1IL1NNdiknLvxtT6\n1dER8G6DJ/GdgW8v1P65q0sSXOm7AgMBAAECgYBhUdouiYKYG5DbmNYnc6YE5pFS\nuZDmwYoBaqBnnC0jIoji0sVtgtd5GegPspzaHXScRLWwuyeYJPLvjNOx/487iO4Q\nRvf1mgZJ/f1c5MzAmGgbiFFfm79wYZEOeFHRUTCzSgNndRaRHZEABriOEKarcdN9\nt+S5I6/8SxBdXgiuAQJBAN5eIaFxgzSNcoOzN339IeeteGTlXwyxqi/D4ODHv0Ro\nwvjccSiW9QFmcy5MmxkYuFWzuJTea2qLVgJam0EngsECQQDLN/7DtXb9F3Ljithx\nF3SckZxr0Z6WAYPct5Qe4W1AA/ap6XbNXfzsk3f92Cl3H3DaZTvfRUkIMRaDlsxW\n0dd7AkBDwGp+xhcz6+T4O6KswHOUI0aLd1d+hqNT6lqaIkIklcbSDFhuBZCg3JY7\nhRu8icugUSHsOdiAnfOWxASJ1YABAkAILUed/lY8Vs4zo6mT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zB9hMpAWF9rax\n3AtqJd7e\n-----END CERTIFICATE-----'
};
http2.createServer(options, app).listen(3000);
The text was updated successfully, but these errors were encountered:
Just vote to get the PR molnarg/node-http2#189 accepted. It doesn't work because one of the functions for compatibility with Node.js core HTTP was not spelled correctly in http2.
Currently,
compression
does not work with http2. I guess, when using http2, doing chunked transfer-enconding is not necessary, so I'm not sure if http2 support is in the scope of this project.The following code tries to use
http2
withcompression
and throws aTypeError: this._implicitHeader is not a function
.The text was updated successfully, but these errors were encountered: