spdy-http2 / node-spdy

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

How to use with Koa v1? #239

Closed crunchtime-ali closed 8 years ago

crunchtime-ali commented 8 years ago

I would like to use spdy (3.0) with the current Koa (1.1.2) but can't get it to work. I dug up a few examples from the issues and tried a few things but all I get is ERR_EMPTY_RESPONSE

const spdy = require('spdy');
const fs = require('fs');
const koa = require('koa');
const keys = require('spdy-keys');
const app = koa();

app.use(function *() {
        debugger
        console.log('secure?' + this.secure)
        console.log(this.protocol)
                this.body="Hello koa"
});

app.listen(3000);
server = spdy.createServer(keys, app.callback());
server.listen(8443);
crunchtime-ali commented 8 years ago

Nevermind...I have to access it via https:// instead of http:// so it was my own fault.