无法使用WebSockets进行连接,无法更改readyState [英] Cannot connect using WebSockets, not changing readyState

查看:180
本文介绍了无法使用WebSockets进行连接,无法更改readyState的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了几种方法,甚至可以从 http://code.google.com/进行复制/粘贴p / phpwebsocket /

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

我正在使用Google Chrome 5.0.375.70测试版,错误始终相同:
错误:INVALID_STATE_ERR:DOM例外11

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

调试时我看到readyState始终为0(连接),没有显示其他错误。

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

任何想法?

推荐答案

目前有2个受支持的草稿野外的WebSocket API。

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

Draft75 ,这是链接的PHP脚本支持的, Draft76 ,需要不同的升级标题和握手,另一个 Draft77 也已完成,可能会突然被浏览器实施。

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.

在Chrome的第5版和第6版之间,他们从 Draft75 进行切换到 Draft76

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

据我所知,PHP脚本在收到无效的升级标头时不会终止连接。因此,Chrome仍会等待握手,这解释了ReadyState不会改变。

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.

这篇关于无法使用WebSockets进行连接,无法更改readyState的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆