title: Run socket.io server in C#
body: <p>I'm running a socket.io server and client locally. The code I'm running to create the server with <code>node</code> is:</p>
  
  <pre><code>var io = require('socket.io').listen(3000);
  
  io.sockets.on('connection', function (socket) {
     socket.on('message', function(data) {
        socket.broadcast.send(data);
        console.log(data);
      });
  });
  
  console.log('listening on port 3000');
  </code></pre>
  
  <p>The client html page that sends the messages is the following:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
      &lt;script src="http://cdn.socket.io/socket.io-1.0.0.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          var socket = io('http://localhost:3000');
  
          setInterval(function() {
              var timestamp = new Date().toTimeString().split(' ')[0];
              socket.send(timestamp + ", " + "&lt;Test message&gt;");
          }, 1000);
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I want to have the data sent to the socket available to C# so want to run the socket.io server in C# rather than Javascript. I can then have access to whatever is sent by the clients to the server. </p>
  
  <p>Any idea how this could be implemented? Is there any other way of sending data from a webpage running locally to a socket server in C# to print it on the console etc? There is quite a lot of data and it's realtime, so it probably needs to be a socket of some kind.</p>