title: Websocket client connection in c# windows forms
body: <p>I'm looking for the way to get data from server using websocket convert them to .json and store them sqlite db to use filtered data in <strong>winforms</strong>. i tried some examples from internet but couldn't get them working.</p>
  <p>Tried this python code:</p>
  <pre><code>import websocket
  import ssl
  
  SOCKET = &quot;wss://xxxxx.io:33010/ws/?EIO=3&amp;transport=websocket&quot;
  
  
  def on_open(ws):
      print('connection: successful')
  
  def on_close(ws, *args):
      print('connection: lost')
  
  def on_message(ws, message):
      print(message)
  
  def on_error(ws, message):
      print(message)
  
  ws = websocket.WebSocketApp(SOCKET, on_open=on_open, on_close=on_close, on_message=on_message, on_error=on_error)
  ws.run_forever(sslopt={&quot;cert_reqs&quot;: ssl.CERT_NONE})
  </code></pre>
  <p>and from this Open Source web link
  <a href="http://livepersoninc.github.io/ws-test-page/?" rel="nofollow noreferrer">http://livepersoninc.github.io/ws-test-page/?</a></p>
  <p>From both i was getting data  from server, but i need something similar only in <strong>C#</strong> any ideas.</p>
  <p>Example text/json from server:</p>
  <pre><code>42[&quot;ticker&quot;,[{&quot;provider&quot;:&quot;lbank&quot;,&quot;pair&quot;:&quot;zec_usdt&quot;,&quot;from&quot;:&quot;ZEC&quot;,&quot;rate&quot;:126.435645,&quot;to&quot;:&quot;USDT&quot;,&quot;timeUtc&quot;:1651350906458,&quot;key&quot;:&quot;lbank:zec_usdt:1651350906458&quot;}]]
  42[&quot;ticker&quot;,[{&quot;provider&quot;:&quot;lbank&quot;,&quot;pair&quot;:&quot;bch_usdt&quot;,&quot;from&quot;:&quot;BCH&quot;,&quot;rate&quot;:285.82794,&quot;to&quot;:&quot;USDT&quot;,&quot;timeUtc&quot;:1651350906470,&quot;key&quot;:&quot;lbank:bch_usdt:1651350906470&quot;}]]
  </code></pre>