[Python] Dealing with HTTP and websocket connections on the backend

Discussão em 'Python' iniciado por Stack, Julho 10, 2025.

  1. Stack

    Stack Membro Participativo

    I am working on a game I want to support over iOS/Android/Browser and thinking Websockets is what I want to use for the communication. I use python and so found that I should be using Tornado.

    I am trying to understand websockets a little better and their integration in browsers.

    1. Will the messages over the websocket connection also contain the HTTP cookies for the connection? If not can I send it?
    2. How is the HTTP connection for the web page linked to the websocket connection? I mean how will I know they are coming from the same webapp on the server side?
    3. The Tornado wiki page says in the performance section that Tornado can be set up with nginx as the front end. How does that work? I thought Tornado and nginx have to be running on separate machines since both listen on port 80 and also because nginx does not understand WS protocol. What am I missing?

    Also it will be great if someone can point me to any resources I can read up on about either Tornado or websocket that could help me.

    Continue reading...

Compartilhe esta Página