title: SignalR Client - The remote server returned an error (401 Unauthorized)
body: <h3>Premise</h3>
  
  <p>I'm attempting to make a windows service act as a signalR client to a web server (MVC3 project running on IIS Express). When trying to connect to the server, a 401 Unauthorized is returned.</p>
  
  <p>Now, as far as I understand, the windows service runs under the account NETWORK_SERVICE, and it makes sense that this is not a valid user name to connect to the IIS. However, I've tried configuring SignalR in the following way:</p>
  
  <h3>Init</h3>
  
  <pre><code>private static Connection WebUIConnection = new Connection("http://localhost:54193/IISWebsite");
  </code></pre>
  
  <h3>Set credentials</h3>
  
  <pre><code>WebUIConnection.Credentials = new System.Net.NetworkCredential("?", "?")
  </code></pre>
  
  <p>The settings of the IIS:
  The IIS is almost a standard MVC3 project, and it has windows authentication enabled.</p>
  
  <h3>What I've tried</h3>
  
  <p>I've tried setting SignalR's credentials as my local windows username + pw, and also tried using the local network AD uname + pw, but I don't see this as being the way to do it.</p>
  
  <p>So what I'm asking is, what should I consider when I try to make my windows service act as a client to the signalR-server, and is there a way to configure IIS to give client access to the Network_Service user? Is it in fact possible to make a windows service act as a client to a web server running in IIS like I'm trying to do?</p>
  
  <p>Thanks, 
  Lari</p>