spdy-http2 / node-spdy

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

ALPN - not working #271

Closed shahamitj closed 7 years ago

shahamitj commented 7 years ago

I have used the following code:

var options = {
  pfx: fs.readFileSync(__dirname + '/config/server.pfx'),

  // **optional** SPDY-specific options
  spdy: {
    plain: false,
    // **optional**
    // Parse first incoming X_FORWARDED_FOR frame and put it to the
    // headers of every request.
    // NOTE: Use with care! This should not be used without some proxy that
    // will *always* send X_FORWARDED_FOR

    connection: {
      windowSize: 1024 * 1024, // Server's window size

      // **optional** if true - server will send 3.1 frames on 3.0 *plain* spdy
      autoSpdy31: false
    }
  }
};

var server = spdy.createServer(options, function(req, res) {
  res.writeHead(200);
  res.end('hello world!');
});

server.listen(8443);

to test out http/2 running Node.js 4.5.0. I'm getting the protocol options via NPN but nothing via ALPN. I'm using https://tools.keycdn.com/http2-test to test out the implementation. Running behind a ELB on TCP load balancing mode.

indutny commented 7 years ago

@shahamitj sorry, I don't think that there is ALPN support in node v4.x. Please give a try to v6.x, if this is acceptable for your project.