Skip to content

Instantly share code, notes, and snippets.

@kysnm

kysnm/index.js Secret

Created December 23, 2016 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kysnm/d971a3bafaf6f147f25d429f93590627 to your computer and use it in GitHub Desktop.
Save kysnm/d971a3bafaf6f147f25d429f93590627 to your computer and use it in GitHub Desktop.
const fs = require('fs');
const http2 = require('http').HTTP2;
const options = {
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};
const server = http2.createSecureServer(options, (req, res) => {
res.writeHead(200, {'content-type': 'text/html'});
res.end('Hello world');
});
server.listen(8000, 'localhost', () => {
console.log('Ready!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment