title: Why socket disconnected?
body: <p>Good day. I'm trying to use streamlabs api <a href="https://streamlabs.readme.io/docs/socket-api" rel="nofollow noreferrer">https://streamlabs.readme.io/docs/socket-api</a></p>
  
  <p>There you can find working examples on js. I'm trying to implement the code on the python using the socketIO library. Tell me why it does not work and in what direction to move?</p>
  
  <pre><code>token = "....."
  import logging
  logging.getLogger('socketIO-client').setLevel(logging.DEBUG)
  logging.basicConfig()
  
  from socketIO_client import SocketIO, LoggingNamespace
  print token
  
  def on_connect():
      print('connect')
  
  def on_disconnect():
      print('wtf')
  
  def on_event(*args):
      print('aaaaaaa', args)
  
  print "connecting"
  print "https://sockets.streamlabs.com?token={}".format(token)
  
  socketIO = SocketIO("https://sockets.streamlabs.com?token={}".format(token),443, LoggingNamespace)
  
  socketIO.on('connect', on_connect)
  socketIO.on('disconnect', on_disconnect)
  socketIO.on('event', on_event)
  socketIO.wait()
  </code></pre>
  
  <blockquote>
    <p>DEBUG:socketIO-client:sockets.streamlabs.com:443/socket.io [engine.io
    transport selected] websocket</p>
    
    <p>DEBUG:socketIO-client:sockets.streamlabs.com:443/socket.io [engine.io
    heartbeat reset]
    DEBUG:socketIO-client:sockets.streamlabs.com:443/socket.io [engine.io
    message]</p>
    
    <p>1</p>
    
    <p>DEBUG:socketIO-client:sockets.streamlabs.com:443/socket.io [socket.io
    packet received]</p>
    
    <p>1</p>
    
    <p>wtf</p>
    
    <p>DEBUG:socketIO-client:sockets.streamlabs.com:443/socket.io [engine.io
    pong] DEBUG:socketIO-client:sockets.streamlabs.com:443/socket.io
    [engine.io pong]
    DEBUG:socketIO-client:sockets.streamlabs.com:443/socket.io [engine.io
    pong] DEBUG:socketIO-client:sockets.streamlabs.com:443/socket.io
    [engine.io pong]
    DEBUG:socketIO-client:sockets.streamlabs.com:443/socket.io [engine.io
    pong]</p>
  </blockquote>
  
  <p>"wtf"  because the socket received </p>
  
  <blockquote>
    <p>DEBUG: socketIO-client: sockets.streamlabs.com: 443 / socket.io
    [socket.io disconnect]</p>
  </blockquote>