spdy-http2 / node-spdy

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

WebSocket compatibility #224

Closed ronkorving closed 8 years ago

ronkorving commented 8 years ago

Right now, when I use https://www.npmjs.com/package/ws on top of a node-spdy server, the following happens:

  spdy:server incoming socket protocol="http/1.1" +8s
  spdy:server to default handler it goes +0ms
  spdy:server incoming socket protocol="http/1.1" +12ms
  spdy:server to default handler it goes +0ms

This might just be Chrome not using the existing HTTP/2 connection that has already been established, or it might be Chrome not supporting WebSocket over HTTP/2. I'm making this issue just in case it may be node-spdy not supporting the protocol upgrade.

Does anyone have any deeper insights on this?

indutny commented 8 years ago

I don't think that http2 is used when establishing websocket connection.

ronkorving commented 8 years ago

Ever? I remember seeing an RFC about this very topic. Not sure about its status though.

tatsuhiro-t commented 8 years ago

IIRC, there was effort to make WebSocket connection over HTTP/2, but there was no consensus about how to achieve it. I'm not sure it is still ongoing. I think all browsers today use HTTP/1.1 connection for WebSocket.

ronkorving commented 8 years ago

Reference: http://tools.ietf.org/html/draft-hirano-httpbis-websocket-over-http2-00 (may be expired, rejected, I don't know) Update: It seems that was no longer a possibility with HTTP/2: https://webtide.com/http2-last-call/