title: Direction needed for self hosted web server for html, json and websockets
body: <h2>Background</h2>
  
  <p>I have a windows console app written in C# which needs UI. I started using WPF, but as I come from a web background, I want to use html, and some features of html5, including web sockets for real time communication with another application.
  Initially, I'll use a web browser as the UI, though I may later host a web browser in the main app. This bit doesn't concern me at the moment.</p>
  
  <p>After a lot of googling/reading, I'm going round in circles. It looks like WCF can be used to serve html, json based web services, and possibly web socket streams.
  A lot of googled info relates to pre .NET 4.0 community projects. Even post 4.0 there are several NuGet packages which seem to me to overlap what is already in the framework. To a WCF noob, it's all a minefield.</p>
  
  <p>So, what areas of .NET 4.0 WCF and the various open source projects should I be concentrating my efforts on.</p>
  
  <h2>Requirements</h2>
  
  <p>I require a lightweight self hosted web server. It cannot be IIS based, as users will not have it installed. The server (or servers) must:</p>
  
  <ol>
  <li>Be able to server complete web pages, including html, linked images, css and js files. <a href="http://www.codeproject.com/KB/IP/minihttpd.aspx" rel="nofollow">C# MiniHttpd</a> does the job well, but is not based on http.sys. HttpListener seems to be the core of what I want, but I haven't found a complete web server project based on it. 
  <ul>
  <li>[optionally] Be able to parse those pages through asp.net or razor</li>
  </ul></li>
  <li>Be able to respond to web service call via json. This bit I have a working example using System.ServiceModel. Is this the right way to go?</li>
  <li>Be able to work with the emerging Web Sockets standard. <a href="http://superwebsocket.codeplex.com/" rel="nofollow">SuperWebSocket</a> is actively developed, but doesn't appear to be http.sys or wcf based.</li>
  </ol>
  
  <h2>Preferences</h2>
  
  <ul>
  <li>I would prefer to stick to one basic stack for all 3 of my main requirements - and I suspect WCF may be that platform.</li>
  <li>I would prefer an http.sys based approach for all three requirements, so I can reserve the relevant url/port/namespace combinations and prevent conflicts with other web servers or services</li>
  </ul>
  
  <p>Although other SO questions may help with individual aspects of my requirements, I need advice on a more holistic approach.</p>