I have server.js
file where is some code
var express = require('express')
var app = express()
var fs = require('fs');
app.get('/', function (req, res) {
res.send('hello, http2!')
})
var options = {
key: fs.readFileSync('./localhost.key'),
cert: fs.readFileSync('./localhost.crt')
};
require('http2').createServer(options, app).listen(8080);
After that I run in shell
$ node server.js
And server is waiting, but I can't open it. I tried http://localhost:8080 and https://localhost:8080 (I know that this is one is right one.). But nothing is going on, no errors no response in browser, what am I doing wrong? Also .key
and .crt
files not generated by me, I just copied it, can this be a problem?
Ok it wasn't http2 issue, just firefox doesn't want to open it.In chrome all works great on https://localhost:8080/.