Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot connect using WebSockets, not changing readyState

Ive tried several approaches and even copy/pasted from http://code.google.com/p/phpwebsocket/

Im using Google Chrome 5.0.375.70 beta and the error is always the same: Error: INVALID_STATE_ERR: DOM Exception 11

when debugging I see the readyState is always 0 (connecting), no other error is shown.

Any ideas?

like image 505
Purefan Avatar asked Aug 05 '26 21:08

Purefan


1 Answers

There are currently 2 supported Drafts of the WebSocket API in the wild.

Draft75 which is the one that is supported by the linked PHP script, and Draft76 which requires a different Upgrade Header and Handshake, another one Draft77 is also finished and may suddenly and up being implement by a Browser.

Somewhere between Version 5 and 6 of Chrome they did the switch from Draft75 to Draft76.

As far as I can see here, the PHP Script does not terminate the connection when it receives an invalid upgrade header. Therefore Chrome will still wait for the Handshake, which explains while the ReadyState does not change.

like image 108
Ivo Wetzel Avatar answered Aug 08 '26 10:08

Ivo Wetzel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!