spdy-http2 / node-spdy

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

`req.connection.server` property is null (differs with Node.js implementation) #303

Open SpaceK33z opened 7 years ago

SpaceK33z commented 7 years ago

When using the Node.js https module, using req.connection.server in a request results in a Server instance.

This example code logs a Server instance (as expected):

var https = require('https');

var server = https.createServer(options, function(req, res) {
    console.log('Server:', req.connection.server);
    res.writeHead(200);
    res.end('hello world!');
});

server.listen(3001);

Note that I executed the script and browsed to https://localhost:3000.

After replacing the first line to var https = require('spdy');, req.connection.server now returns null. This breaks http-proxy-middleware, which relies on this property to be set when using it with a WebSocket (see https://github.com/chimurai/http-proxy-middleware/issues/143).

jorgejar commented 7 years ago

Ive noticed the same problem. Would be great to get a patch in.