简体   繁体   English

最新的Openshift更新后Socket.IO客户端无法连接到Socket.IO nodejs服务器

[英]Socket.IO Client fail to connect to Socket.IO nodejs server after latest Openshift update

I have a nodejs v0.10 server with socket.io (v0.9.16) running on Openshift, for the past 2 months it has no problem receiving data from my Android apps connecting to the server using AndroidAsync ( https://github.com/koush/AndroidAsync ). 我有一个在Openshift上运行带有socket.io(v0.9.16)的nodejs v0.10服务器,在过去的2个月中,从使用AndroidAsync( https://github.com / koush / AndroidAsync )。 Suddenly after Openshift upgrade its service on 25th Feb the Android app fail to connect to the server. Openshift在2月25日升级其服务后,Android应用突然无法连接到服务器。 Every time the app tries to connect the server, the server will output an error, I run Socket.IO in debug mode and this appear (debug: destroying non-socket.io upgrade). 每次应用程序尝试连接服务器时,服务器都会输出错误,我在调试模式下运行Socket.IO并显示(调试:销毁non-socket.io升级)。

Funny thing is, the same server also host my web client running the same socket.io library, and it has no problem whatsoever with the web client. 有趣的是,同一台服务器还托管了运行相同socket.io库的我的Web客户端,并且Web客户端没有任何问题。 Can someone please point me to the right direction? 有人可以指出我正确的方向吗? I am connecting to the server with http://www.xxxxxx.com:8000/ where 8000 is the websocket port given by Openshift. 我使用http://www.xxxxxx.com:8000/连接到服务器,其中8000是Openshift提供的websocket端口。

I read that "destroying non-socket.io upgrade" might due to invalid/incompatible socket.io js file, I tried to do a manual check on the socket.io file by typing this in my browser 我读到“销毁非socket.io升级”可能是由于无效/不兼容的socket.io js文件引起的,我试图通过在浏览器中键入此内容来对socket.io文件进行手动检查

http://www.xxxxxx.com:8000/socket.io/1/ http://www.xxxxxx.com:8000/socket.io/1/

I got this return code: 我得到了这个返回码:

An-vI1BJofr45j9c_GmH:60:60:websocket,htmlfile,xhr-polling,jsonp-polling 一个-vI1BJofr45j9c_GmH:60:60:的WebSocket,HTMLFILE,XHR轮询,JSONP轮询

PS: My Android code hasn't been changed, and so is my server code. PS:我的Android代码未更改,我的服务器代码也未更改。 PPS: I have successfully connect in localhost environment and my own server. PPS:我已经在本地主机环境和我自己的服务器上成功连接。 So the problem is most probably originated from Openshift, not sure what have been updated to break it. 因此,问题很可能源于Openshift,不确定是否已对其进行更新以解决此问题。

All of a sudden it works again without any code changes. 突然之间,它无需更改任何代码即可再次运行。 I would however recommended anyone using my approach of connecting to backend server to have a http push backup just incase any future server updates breaks it again. 但是,我建议任何使用我的方法连接到后端服务器的人进行http推送备份,以防万一以后的服务器更新再次破坏它。

Would appreciate if anyone from Openshift can help clarify this to prevent sudden death on running production apps. 如果来自Openshift的任何人都可以帮助澄清这一点,以防止运行生产应用程序时突然死亡,将不胜感激。 Thanks. 谢谢。

Make sure to check OpenShift Online's system status page to see if your apps have been impacted by a system outage. 确保检查OpenShift Online的系统状态页面,以查看您的应用是否受到系统中断的影响。 (fyi: we run on top of AWS) (仅供参考:我们在AWS之上运行)

I would definitely consider using one of OpenShift Online's paid hosting plans for production quality applications. 我绝对会考虑将OpenShift Online的付费托管计划之一用于生产质量的应用程序。 Apps that are created using paid plans go onto a separate array of machines (more resources), and are configured to be more highly-available (no sleeping due to inactivity). 使用付费计划创建的应用程序将进入单独的计算机阵列(更多资源),并且配置为更高可用性(由于不活动而不会进入睡眠状态)。

Hope this helps answer your question. 希望这有助于回答您的问题。 Please close if so. 如果是这样,请关闭。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM