简体   繁体   English

我在IOS上的Socket.io无法与WebSocket服务器握手

[英]My Socket.io on IOS fails to handshake with the websocket server

I have a Node.js server running Websocket. 我有一台运行Websocket的Node.js服务器。 (using Pomelo). (使用柚)。 I am able to run a web application and connect to it (localhost @port 3104). 我能够运行一个Web应用程序并连接到它(localhost @port 3104)。

however, when I try to use socket.io (SocketRocket) for IOS and connect to the same localhost and port, I get this error: 但是,当我尝试对IOS使用socket.io(SocketRocket)并连接到相同的localhost和端口时,出现此错误:

> http://127.0.0.1:3014/socket.io/1/?t=16807 
> "ERROR: handshake failed ... The request timed out"

detail of the error: 错误的详细信息:

Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x6c723c0 
{NSErrorFailingURLStringKey=http://127.0.0.1:3014/socket.io/1/?t=16807, NSErrorFailingURLKey=http://127.0.0.1:3014/socket.io/1/?t=16807, NSLocalizedDescription=The request timed out., NSUnderlyingError=0x6c72400 "The request timed out."}

i tried. 我试过了。 127.0.01, localhost... even explicit IP address.. all fail 127.0.01,本地主机...甚至显式IP地址..都失败

any idea what I should check? 知道我应该检查什么吗? and should it be "http" protocol ? 并且应该是“ http”协议吗? or wss? 还是wss?

Got it working.. I just cannot run a websocket server. 它能正常工作..我只是无法运行websocket服务器。 I have to run a socket.io server... then it works. 我必须运行一个socket.io服务器...然后它可以工作。

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

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