spdy-http2 / node-spdy

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

iOS clients fails with 'h2' protocol enabled #228

Closed djphoenix closed 8 years ago

djphoenix commented 8 years ago

Environment:

$ lsb_release -d
Description:    Debian GNU/Linux 8.2 (jessie)
$ node -v
v4.1.2
$ cat /usr/lib/node_modules/spdy/package.json | grep version
  "version": "2.0.5"

With default options (no spdy-protocols specified) iOS Safari clients (tested on iOS 9.0.2) fails to load web page - connection freezes. At this point, all PC browsers (Mac Safari too) loads resource successfully. With this option load (on iOS) succeeds, but other browsers falls back to spdy/3.1 (h2 disabled):

spdy: {
    protocols: [/*'h2',*/'spdy/3.1','spdy/3','spdy/2','http/1.1','http/1.0'],
}

Bug also can be reproduced using Xcode iOS simulator. iOS 6 clients works normally (because HTTP2 not implemented at OS level).

indutny commented 8 years ago

Hm... I just tested it locally, and appears to be working fine with iOS simulator. May I ask you to start your server with DEBUG="spdy*" environment variable, and report back the logs that it will print?

djphoenix commented 8 years ago

Oh. Sorry for wrong information. In my server code I was forced 'connection' header to 'keep-alive' value. At this point I was removed all 'connection' headers from responses if npnProtocol is 'h2' - that is works now.

Maybe needed workaround in module for this case?

indutny commented 8 years ago

@djphoenix thanks! Should be fixed with an update of spdy-transport. Please try running npm update and testing it again.

djphoenix commented 8 years ago

@indutny big thx, now works without any workarounds.