Socket.io没有明显的原因恢复到XHR / JSONP轮询 [英] Socket.io reverting to XHR / JSONP polling for no apparent reason

查看:113
本文介绍了Socket.io没有明显的原因恢复到XHR / JSONP轮询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为Socket.IO应该选择最好的方法来查找系列中服务器
的连接,

I think Socket.IO should choose The best method to find connection with the server in the series ,


  Websocket , 
  FlashSocket  
  and then JSONP


但是我的服务器在节点0.4.9的顶部运行socket.io 0.7.7(在用cygwin编译的窗口上)进入XHR / JsonP轮询没有任何明显的原因。我已经检查了80-89的所有端口以确保,问题始终保持不变。

but my server which is running socket.io 0.7.7 on the top of node 0.4.9 (on windows compiled with cygwin) goes to XHR/JsonP polling without any apparent reason. I have checked on all ports from 80 - 89 just to make sure , and the problem remains the same all the time.

我还检查了两侧的控制台日志。
Firebug给出没有错误只是向我显示XHR获取请求。

I also checked for console logs in both the sides. Firebug Gives No error just shows me the XHR get requests instead.

并且在服务器控制台上它给了我:

and On the Server Console it gives me :

   info - socket.io started
   debug - client authorised  // i dunno why this is occuring though
   info - handshake autorised 154845454664764
   setting request Get/socket.io/1/xhr-polling/154845454664764
   debug - setting poll timeout



。等等
任何理由的人?

. . . and so on Any reason in mind guys ??

推荐答案

您可能正在使用禁用了WebSockets的Firefox


警告:除此之外,Firefox 4和5中默认禁用WebSockets目前
的一个关键原因是在协议设计中发现了一个安全
问题。目前不建议在生产环境中使用这些版本的
Firefox中的WebSockets。
如果您仍想尝试使用WebSockets,可以通过
打开about:config并将network.websocket.enabled
首选项设置为true。您还需要将
network.websocket.override-security-block首选项设置为true,以便
允许初始化WebSocket连接。

Warning: Among other things, a key reason WebSockets is currently disabled by default in Firefox 4 and 5 is the discovery of a security issue in the protocol's design. Using WebSockets in those versions of Firefox in a production environment is not recommended at this time. If you still wish to experiment with WebSockets, you may do so by opening about:config and setting the network.websocket.enabled preference to true. You will also need to set the network.websocket.override-security-block preference to true in order to allow initializing a WebSocket connection.

这篇关于Socket.io没有明显的原因恢复到XHR / JSONP轮询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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