简体   繁体   中英

Can't run sample code with TestChat from SocketRocket

I'm launching python server, seems it's working OK, but I can't connect to it from iOS TestChat and I'm receiving Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused"

在此处输入图片说明

SocketRocket iOS client

python websocket server on Tornado

Just didn't noticed in python code right URL to connect:

application = tornado.web.Application([
        (r"/chat", ChatHandler),
        (r"/(.*)", tornado.web.StaticFileHandler, {"path": args.static_path, "default_filename":'index.html'}),
])

So the right URL to connect from iOS client is [NSURL URLWithString:@"ws://localhost:9000/chat"]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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