title: Difference between websocket and websockets
body: <p>I don't understand the difference between websocket (websocket client) and websockets.
  I would like to understand the difference to know which one uses to be optimal.</p>
  
  <p>I have a code that seems to do the same thing.</p>
  
  <pre><code>import websockets
  import asyncio
  import json
  
  async def capture_data():
      uri = "wss://www.bitmex.com/realtime?subscribe=instrument:XBTUSD"
      #uri = "wss://www.bitmex.com/realtime"
      async with websockets.connect(uri) as websocket:
          while True:
              data = await websocket.recv()
              data = json.loads(data)
              try :
                  #print('\n', data['data'][0]["lastPrice"])
                  print('\n', data)
              except KeyError:
                  continue
  
  
  asyncio.get_event_loop().run_until_complete(capture_data())
  </code></pre>
  
  <pre><code>import websocket
  import json
  
  def on_open(ws):
      print("opened")
  
      auth_data = {
          'op': 'subscribe',
          'args': ['instrument:XBTUSD']
      }
      ws.send(json.dumps(auth_data))
  
  def on_message(ws, message):
      message = json.loads(message)
      print(message)
  
  def on_close(ws):
      print("closed connection")
  
  
  socket = "wss://www.bitmex.com/realtime"                 
  ws = websocket.WebSocketApp(socket, 
                              on_open=on_open, 
                              on_message=on_message,
                              on_close=on_close)     
  ws.run_forever()
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Is Python powerful enough to receive a lot of data via websocket?
  In times of high traffic, I could have thousands of messages per second and even tens of thousands for short periods of time.</p>
  
  <p>I've seen a lot of things about Nodejs that might be better than python but I don't know js and even if I just copy code from the internet I'm not sure I wouldn't waste time if I have to send the data to my python script and then process it.</p>