title: SignalR Error loading hubs. How to handle when service is down
body: <p>I have a <code>SignalR</code> application that is a <code>Self-Hosted Windows Service Hub</code>.</p>
  
  <p>My javascript client have in the index.html:</p>
  
  <pre><code>&lt;script src="http://localhost:8080/signalr/hubs"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>But the Windows Service it not always running. So if it's not running and I try to load index.html I get the error:</p>
  
  <pre><code>Uncaught Error: SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. &lt;script src='/signalr/js'&gt;&lt;/script&gt;. 
  </code></pre>
  
  <p>And makes sense because it wont find the javascript file until the Windows Service is running.</p>
  
  <p>So my question is, how can I make it flexible so I don't get any error if the Windows Service is not running (localhost:8080).</p>
  
  <p>Any clue?</p>