title: How to track 500 errors on WebSockets (ws://)
body: <p>I'm trying to play around with WebSockets on IIS 8.5. I started off with a couple of very basic C# classes from a lesson:</p>
  
  <pre><code>using Microsoft.Web.WebSockets;
  using System.Web;
  
  public class ChatHttpHandler : IHttpHandler
  {
      public void ProcessRequest(HttpContext context)
      {
          if (context.IsWebSocketRequest)
              context.AcceptWebSocketRequest(new WebSocketChatHandler());
      }
  
      public bool IsReusable
      {
          get { return true; }
      }
  }
  
  public class WebSocketChatHandler : WebSocketHandler
  {
      private static WebSocketCollection clients = new WebSocketCollection();
      private string name;
  
      public override void OnOpen()
      {
          this.name = this.WebSocketContext.QueryString["username"];
          clients.Add(this);
          clients.Broadcast(string.Format("{0} joined.", name));
      }
  
      public override void OnMessage(string message)
      {
          clients.Broadcast(string.Format("{0}: {1}", name, message));
      }
  
      public override void OnClose()
      {
          clients.Remove(this);
          clients.Broadcast(string.Format("{0} left.", name));
      }
  }
  </code></pre>
  
  <p>and a simple HTML client. The project builds ok, but when I try to connect to the handler, it returns error 500. The problem is that I cannot see what the exact error is, because neither Chrome nor FF load the response body for ws:// scheme, so i cannot even see it in the Network tab of Developer Tools (though IIS provides the body, as I can see from from the response' Content-Length).
  Is there a way to see the response body in this situation? Or what am I missing with WebSockets in IIS?</p>