title: It's possible to connect to "HTTP Long Polling server" as a "client" with .NET WebSockets?
body: <p>I'am looking at <a href="https://github.com/gigobyte/HLTV/blob/master/src/endpoints/connectToScorebot.ts" rel="nofollow noreferrer">this sample connection</a> with <a href="https://socket.io" rel="nofollow noreferrer">socket.io</a> and I'am trying to make a client to connect on &quot;https://scorebot-lb.hltv.org&quot;(this not is an web socket Api) with .NET WebSockets for example.</p>
  <p><strong>Sample Node.js syntax</strong></p>
  <pre><code>SampleConn = async () =&gt; {
  
      const url = 'https://scorebot-lb.hltv.org'
      const matchId = 2348837
  
      const socket = io.connect(url)
  
      const initObject = JSON.stringify({
          token: '',
          listId: matchId
      })
  
      let reconnected = false
  
      socket.on('connect', () =&gt; {
  
          if (!reconnected) {
              socket.emit('readyForMatch', initObject)
          }
  
          socket.on('scoreboard', (data) =&gt; {
              ...
          })
  
          socket.on('log', (data) =&gt; {
              ...
          })
  
          socket.on('fullLog', (data) =&gt; {
              ...
          })
      })
  
      return &quot;&quot;;
  };
  </code></pre>
  <p>This sample in Node.js works perfectly. But in my tentatives with .NET defaults, the sockets configurations wants a &quot;ws://&quot; or &quot;wss://&quot; urls and if you try to put &quot;https://scorebot-lb.hltv.org&quot; we got some errors, like:</p>
  <pre><code>1 - HostNotFound;
  2 - System.ArgumentException: 'The scheme part isn't 'ws' or 'wss': https://scorebot-lb.hltv.org';
  3 - System.ArgumentException: 'Not an absolute URI: scorebot-lb.hltv.org';
  </code></pre>
  <p><strong>Others tests, but without success:</strong></p>
  <p><a href="https://github.com/sta/websocket-sharp" rel="nofollow noreferrer"><strong>WebSocketSharp</strong></a></p>
  <pre><code>public static void Main(string[] args)
  {
       using (var ws = new WebSocketSharp.WebSocket(&quot;scorebot-lb.hltv.org&quot;))
       {
            ws.OnMessage += (sender, e) =&gt;
               Console.WriteLine(&quot;...&quot;);
  
            ws.Connect();
            ws.Send(&quot;...&quot;);
            Console.ReadKey(true);
       }
  }
  </code></pre>
  <p><strong><a href="https://github.com/uhm0311/SocketIOSharp#client" rel="nofollow noreferrer"><strong>SocketIOSharp</strong></a></strong></p>
  <pre><code>class Program
  {
      public static void Main(string[] args)
      {
          try
          {
              var options = new SocketIOClientOption(EngineIOScheme.http, &quot;scorebot-lb.hltv.org&quot;, 80);
              var client = new SocketIOClient(options);
  
              client.Connect();
  
              client.On(&quot;connect&quot;, () =&gt; {
  
                  client.Emit(&quot;readyForMatch&quot;, &quot;{'token':'','listId':2348837}&quot;);
  
                  client.On(&quot;scoreboard&quot;, () =&gt; {});
  
                  client.On(&quot;log&quot;, () =&gt; { });
  
                  client.On(&quot;fullLog&quot;, () =&gt; { });
              });
  
              Console.WriteLine();
  
          }
          catch (Exception ex)
          {
              throw;
          }
      }
  }
  </code></pre>
  <p>What's the path? It's possible?</p>
  <p><em><strong>[UPDATE]</strong></em></p>
  <p>In short, no it's not possible. Before I wrote this question, I didn't know that HLTV score board used socket.io(I thought it was something related to HTTP Long Polling), so, we need a socket.io client library to do this. Please check my answer.</p>