J'essaie d'utiliser HTTP/2. Mon site express La version est 5.0.0-alpha.2, http2 est la version 3.3.4.
Je suppose http2 devrait fonctionnent bien avec express 5 .
const http2 = require('http2');
// const http2 = require('spdy'); // using spdy package here, everything works perfect
const options = {
key: fs.readFileSync(path.join(__dirname, 'private', 'server.key')),
cert: fs.readFileSync(path.join(__dirname, 'private', 'server.crt'))
};
const server = http2
.createServer(options, app)
.listen(3000, err => {
if (err) throw new Error(err);
// I can see "Listening..." message, which means the server starts running well.
console.log('Listening...');
});
Le serveur fonctionne bien, mais lorsque j'ouvre le site Web du client, il me donne cette erreur dans le terminal :
_stream_readable.js:512 dest.end(); ^ TypeError: dest.end is not a function at Stream.onend (_stream_readable.js:512:10) at Stream.g (events.js:286:16) at emitNone (events.js:91:20) at Stream.emit (events.js:185:7) at endReadableNT (_stream_readable.js:975:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)