when I run my code on my pc and try to connect socket with my index.html on localhost no problem but when I try to run my code on server and try to connect socket with index.html(it locate on my pc) I get :
Router <tornadio2.session.ConnectionInfo object at 0x7f7bfc5fac10>
INFO:tornado.access:200 GET /socket.io/1/
DEBUG:root:Initializing websocket handler.
WARNING:tornado.access:403 GET /socket.io/1/websocket/c0532cea9001408c50a9c854f4bce5d8
and after that it switch protocal to xhr-polling but I want to use websocket.
INFO:tornado.access:200 GET /socket.io/1/xhr-polling/62f9b31662c984201685a830c764765e
DEBUG:root:Initializing xhr-polling transport.
DEBUG:root:>>> 1::/socket
DEBUG:root:<<< 1::/socket
DEBUG:root:<<< 3::/socket:connected!
what can I do to fix that problem ?
The html must be loaded from the same server as the websocket unless you override check_origin to allow cross-origin access: http://www.tornadoweb.org/en/stable/websocket.html#tornado.websocket.WebSocketHandler.check_origin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With