title: Flask - websocket doesn't work correctly in a real server
body: <p>I've developed a WebApp with Flask, where different threads check a status and, if something changes they send a new json to the client. Then the client, with the javascript, can update the html page.
  Running the app in my LAN, different clients connect and everything work correctly.</p>
  <p>If I run the app on a real server (such as AWS, by using &quot;flask run --host=0.0.0.0&quot; ), the clients can connect and show the web page, but they don't receive the json sent by the socket of the webapp.</p>
  <p>In the WebApp, a thread sends the new json by calling a function that uses:</p>
  <pre><code>socketio.emit('update', {'number': new_json_FE}, namespace='/test')
  </code></pre>
  <p>While the javascript receives this message (and does something) in this way:</p>
  <pre><code>socket.on('update', function(msg) { ....}
  </code></pre>
  <p>It is very strange that the clients connected in the LAN receive correctly all the json sent by the socket, while in the web not: they only receive the json when they connect to, and I have to upload the page (they don't receive the socket messages).</p>
  <p>Can you help me?</p>
  <p>Thank you very much!</p>