Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: "upgrade" event not triggered with a Firefox client #588

Closed
silverwind opened this issue Jan 24, 2015 · 8 comments
Closed

http: "upgrade" event not triggered with a Firefox client #588

silverwind opened this issue Jan 24, 2015 · 8 comments
Labels
confirmed-bug Issues with confirmed bugs. http Issues or PRs related to the http subsystem.

Comments

@silverwind
Copy link
Contributor

Below packet from a Firefox client doesn't trigger an "upgrade" event. I've tested two different websocket libraries so far which aren't able to handshake when running on io.js but are able to do on node 0.10.35. Also, Chrome seems unaffected, so I suspect something in the packet itself triggering this bug.

Packet from Wireshark:

Frame 98: 559 bytes on wire (4472 bits), 559 bytes captured (4472 bits)
Raw packet data
Internet Protocol Version 4, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: 3258 (3258), Dst Port: 8989 (8989), Seq: 1, Ack: 1, Len: 519
Hypertext Transfer Protocol
    GET / HTTP/1.1\r\n
    Host: localhost:8989\r\n
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0\r\n
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
    Accept-Language: en-US,en;q=0.5\r\n
    Accept-Encoding: gzip, deflate\r\n
    Sec-WebSocket-Version: 13\r\n
    Origin: http://localhost:8989\r\n
    Sec-WebSocket-Key: LCDSLtOtfufP3W706y+1bw==\r\n
    Cookie: s=tJTkrO8mlzGBz/K3HUzcf3TnS5pJbfAJJ8FtzPznnCA=\r\n
    Connection: keep-alive, Upgrade\r\n
    Pragma: no-cache\r\n
    Cache-Control: no-cache\r\n
    Upgrade: websocket\r\n
    \r\n
    [Full request URI: http://localhost:8989/]
    [HTTP request 1/1]
@silverwind silverwind changed the title http: "upgrade" event doesn't fire on Firefox http: "upgrade" event not triggered with a Firefox client Jan 24, 2015
@silverwind
Copy link
Contributor Author

Compared to a Chrome client, I see that the Connection header differs:

Chrome:

Connection: Upgrade
Upgrade: websocket

Firefox:

Connection: keep-alive, Upgrade
Upgrade: websocket

Digging deeper...

@vkurchatkin vkurchatkin added the http Issues or PRs related to the http subsystem. label Jan 24, 2015
@silverwind
Copy link
Contributor Author

@indutny could this change be the culprit here? nodejs/http-parser@091ebb8

@indutny
Copy link
Member

indutny commented Jan 24, 2015

It might be, looking...

@indutny
Copy link
Member

indutny commented Jan 24, 2015

Should be fixed by nodejs/http-parser#216

@indutny
Copy link
Member

indutny commented Jan 24, 2015

Thanks

@silverwind
Copy link
Contributor Author

I'm now convinced that @indutny isn't human. Awesomely fast, thanks!

@silverwind
Copy link
Contributor Author

Compiled your branch with the fix and my websockets are connecting again! 👍

indutny added a commit to nodejs/http-parser that referenced this issue Jan 25, 2015
Fix: nodejs/node#588
PR-URL: #216
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
indutny added a commit to indutny/io.js that referenced this issue Jan 25, 2015
indutny added a commit that referenced this issue Jan 25, 2015
Fix: #588
PR-URL: #604
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@indutny
Copy link
Member

indutny commented Jan 25, 2015

Shall be fixed in 88aaff9

KjellSchubert pushed a commit to KjellSchubert/http-parser that referenced this issue Apr 18, 2015
Fix: nodejs/node#588
PR-URL: nodejs#216
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants