title: How can I get websocket connection to Kucoin Exchange
body: <p>How can I get websocket connection to Kucoin Exchange? I`m trying that code:</p>
  <pre><code>import os
  import time, hashlib, requests, base64, hmac, json, websocket, uuid    
  now = str(int(time.time() * 1000))
  token = &quot;my token&quot;
  SOCKET = f'wss://push1-v2.kucoin.net/endpoint?token={token}&amp;connectId={now}'
  params = {&quot;type&quot;: &quot;subscribe&quot;, &quot;topic&quot;: &quot;/market/ticker:BTC-USDT&quot;, &quot;response&quot;: True}
  
  def on_open(ws):
      print('Opened Connection')
      ws.send(json.dumps(params))
  
  def on_close(ws):
      print('Closed Connection')
  
  def on_ping(ws, message):
      pass
  
  def on_pong(ws, message):
      pass
  
  def on_message(ws, message):
      print(message)
  
  def on_error(ws, err):
    print(&quot;Got a an error: &quot;, err)
  
  if __name__ == &quot;__main__&quot;:
      ws = websocket.WebSocketApp(SOCKET, on_open = on_open, on_close = on_close, on_message = on_message,on_error=on_error, on_ping=on_ping, on_pong=on_pong)
      ws.run_forever(ping_interval=10, ping_timeout=5)
  </code></pre>
  <p>But I get message: [Errno 11001] getaddrinfo failed
  Maybe I use wrong endpoint? Which endpoint I have to use?</p>