title: flask showing error when using emit function
body: <p>I am receiving data from a TCP server and I am passing it to client using websocket for which it is showing working outside of request context
  The code is something like this</p>
  
  <pre><code>def recv(msg):
       data=msg
       emit('info',{'data': data})
  </code></pre>
  
  <p>and my html script code is</p>
  
  <pre><code> &lt;script type ='text/javascript'&gt;
   var socket = io.connect('http://' + document.domaiin + ':' + location.port)
  
   socket.on('info', function(msg){
           console.log(msg);
      });
  </code></pre>
  
  <p></p>
  
  <p>But there is no output on the console.</p>