title: How to make communication between Python client and NodeJS server using socket IO?
body: <p>I am trying to make communication between NodeJS server and Python client process with Socket IO.To get started, I want to send input message from Python process to NodeJs Process, and it can console.log the message.</p>
  
  <p>I followed sample code in <a href="https://pypi.org/project/socketIO-client/" rel="nofollow noreferrer">https://pypi.org/project/socketIO-client/</a>.</p>
  
  <p>In my app.js (nodejs file):</p>
  
  <pre><code>var express        = require("express");
  var app            = express();
  var server         = require("http").Server(app);
  var io             = require('socket.io')(server);
  server.listen(3000,()=&gt;{
      console.log("Succesful");
  });
  io.on('connection',function(socket){
      //data is the message I wish to receive from python
      socket.on('news',(data)=&gt;{  
      console.log(data);
      });
  });
  </code></pre>
  
  <p>In python script(which dies after I input my data):</p>
  
  <pre><code>from socketIO_client import SocketIO,LoggingNamespace
  import logging
  
  while True:
      data = input("Enter your test data here:")
      with SocketIO('localhost', 3000, LoggingNamespace) as socketIO:
          socketIO.emit('news',{data : data})
          socketIO.wait(seconds=1)
  </code></pre>
  
  <p><strong>The problem:</strong> 
  When I try to execute my python code, I get this error after input my data</p>
  
  <pre><code>File "/home/anhtumai/.local/lib/python2.7/site- 
  packages/socketIO_client/__init__.py", line 353, in __init__
  resource, hurry_interval_in_seconds, **kw)
  File "/home/anhtumai/.local/lib/python2.7/site- 
  packages/socketIO_client/__init__.py", line 54, in __init__
  self._transport
  File "/home/anhtumai/.local/lib/python2.7/site- 
  packages/socketIO_client/__init__.py", line 62, in _transport
  self._engineIO_session = self._get_engineIO_session()
  File "/home/anhtumai/.local/lib/python2.7/site- 
  packages/socketIO_client/__init__.py", line 76, in 
  _get_engineIO_session
  transport.recv_packet())
  StopIteration'
  </code></pre>
  
  <p>What do I need to modify in my scripts(both NodeJS and Python)?</p>