简体   繁体   English

Socket.io未连接

[英]Socket.io Not Connecting

I'm wondering how I can connect to a socket.io websocket server externally. 我想知道如何从外部连接到socket.io websocket服务器。 I've been using wscat to test connections but to no avail. 我一直在使用wscat测试连接,但无济于事。 The code I'm using is here . 我正在使用的代码在这里 Anyways, I've tried wscat'ing to where I deployed it, which is c9, but that hasn't worked. 无论如何,我已经尝试过将wscat'ing部署到c9的位置,但这没有用。 I've recieved an ECONNREFUSED error from wscat. 我从wscat收到一个ECONNREFUSED错误。 Is there a specific thing I need to do to enable socket.io connections from outside of a page hosted on the same server? 我需要做些特定的事情来从同一服务器上托管的页面外部启用socket.io连接吗? The end game is to be able to connect to the socket.io server with an iOS app. 最终的游戏是要能够使用iOS应用程序连接到socket.io服务器。

Thanks 谢谢

You must use a Socket.IO library for your language. 您必须为您的语言使用Socket.IO库。 Socket.IO is not plain websockets and cannot be used as such. Socket.IO不是普通的websocket,因此不能使用。

Instead, look at something like: https://github.com/pkyeck/socket.IO-objc 相反,请看以下内容: https : //github.com/pkyeck/socket.IO-objc

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

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