spdy-http2 / node-spdy

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

koa this.secure always returns false #217

Closed gx0r closed 9 years ago

gx0r commented 9 years ago
const spdy = require('spdy');
const fs = require('fs');
const koa = require('koa');
const app = module.exports = koa();

app.use(function *() {
        debugger
        console.log('secure?' + this.secure)
        console.log(this.protocol)
});

app.listen(3000);
server = spdy.createServer({
        key: fs.readFileSync('server.key', 'utf8'),
        cert: fs.readFileSync('server.crt', 'utf8')
}, app.callback());
server.listen(8443);

this.protocol gives 'http' but should be https

indutny commented 9 years ago

Fixed, thanks!