ioswebsocketchatsocketserversocketrocket

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"

enter image description here

SocketRocket iOS client

python websocket server on Tornado


Solution

  • 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"]