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

有些话、适合烂在心里 提交于 2019-12-10 11:59:06

问题


I have a Node.js server running Websocket. (using Pomelo). I am able to run a web application and connect to it (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:

> 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

any idea what I should check? and should it be "http" protocol ? or wss?


回答1:


Got it working.. I just cannot run a websocket server. I have to run a socket.io server... then it works.



来源:https://stackoverflow.com/questions/22052042/my-socket-io-on-ios-fails-to-handshake-with-the-websocket-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!