spdy-http2 / node-spdy

SPDY server on Node.js
2.81k stars 196 forks source link

ERR_EMPTY_RESPONSE #317

Open hitao123 opened 7 years ago

hitao123 commented 7 years ago

env: win 10 node v7.10.0 chrome 57.0.2987.133

const http2 = require('spdy');
const express = require('express');
const fs = require('fs');

const options = {
    key: fs.readFileSync(__dirname + '/localhost.key','utf-8'),
    cert: fs.readFileSync(__dirname + '/localhost.crt','utf-8')
};
console.log(options);
const port = 5000;
const app = express();

app.get('*', (req, res) => {
    res.status(200);
    res.set('Content-Type', 'text/html');
    res.send('<h1>hello express!</h1>');

});

http2.createServer(options, app).listen(port, (error) => {
    if (error) {
        console.error(error)
        return process.exit(1)
    } else {
        console.log('Listening on port: ' + port + '.')
    }
})

anyone could help me?

hitao123 commented 7 years ago

sorry, i make a mistake, i open the page using http but https