{"library":"node-http2","title":"node-http2","description":"The `node-http2` package (version 4.0.1) provides a pure JavaScript implementation of the HTTP/2 client and server protocols, aiming for API compatibility with Node.js's standard HTTPS module. Originally forked from `molnarg/node-http2`, this specific `kaazing/node-http2` version was released around 2017. Its primary differentiating features were its full JavaScript implementation and inclusion of server push capabilities prior to widespread native HTTP/2 support in Node.js. However, since Node.js v8.0.0 (released May 2017) included experimental built-in HTTP/2 support, and especially with its stabilization in Node.js v10.0.0, this package has been superseded. As such, it is no longer actively maintained and should generally not be used in new projects.","language":"javascript","status":"abandoned","last_verified":"Tue Apr 21","install":{"commands":["npm install node-http2"],"cli":null},"imports":["import { createServer } from 'node-http2';","const http2 = require('node-http2');\nhttp2.get(url, callback);","const { Http2Server } = require('node-http2');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const fs = require('fs');\nconst http2 = require('node-http2'); // Explicitly import this package\n\n// Ensure you have localhost.key and localhost.crt in an 'example' directory\n// For testing, you can generate self-signed certificates:\n// openssl genrsa -out example/localhost.key 2048\n// openssl req -new -x509 -key example/localhost.key -out example/localhost.crt -days 365 -subj \"/CN=localhost\"\n\nconst options = {\n  key: fs.readFileSync('./example/localhost.key'),\n  cert: fs.readFileSync('./example/localhost.crt')\n};\n\nhttp2.createServer(options, function(request, response) {\n  response.end('Hello world from node-http2!');\n}).listen(8080, () => {\n  console.log('node-http2 server listening on port 8080 (HTTPS/2)');\n  console.log('Try: curl --http2 -k https://localhost:8080/');\n});","lang":"javascript","description":"Starts an HTTPS/2 server on port 8080 using `node-http2`, serving a 'Hello world' response. Requires self-signed certificates for local testing.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}