-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
Closed
Labels
http2Issues or PRs related to the http2 subsystem.Issues or PRs related to the http2 subsystem.
Description
- Version: v9.0.0-pre
- Platform: Linux linuxbox 4.10.0-30-generic fix LICENSE #34~16.04.1-Ubuntu SMP Wed Aug 2 02:13:56 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
- **Subsystem: http2
// Server
const http2 = require('http2');
const hostname = '127.0.0.1';
const port = 3000;
// Create a plain-text HTTP/2 server
const server = http2.createSecureServer();
server.on('stream', (stream, headers) => {
// stream is a Duplex
stream.respond({
'content-type': 'text/html',
':status': 200
});
stream.end('<h1>Hello World</h1>');
});
server.listen(port, hostname, () => {
console.log(`Server running at https://${hostname}:${port}/`);
});
./node --expose-http2 http2server.js (node:21866) ExperimentalWarning: The http2 module is an experimental API. Server running at https://127.0.0.1:3000/
https://127.0.0.1:3000/ is unreachable and no warnings in terminal
Note: this behavior is the same with https module
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
http2Issues or PRs related to the http2 subsystem.Issues or PRs related to the http2 subsystem.