title: Issues with SignalR and Cross Domain requests in Chrome 27
body: <p><strong>EDIT: This is apparently only a problem in Chrome, it works fine in FF and IE</strong></p>
  
  <p><strong>Chrome version: 27.0.1453.116</strong></p>
  
  <p>I've got a simple JS/HTML site on localhost:13371, and I'm trying to access a SignalR hub at localhost:13371.</p>
  
  <p>Whenever the request is made, I get the following error:</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load <code>http://localhost:13370/signalr/hubs/negotiate?_=1372338722032</code>. Origin <code>http://localhost:13371</code> is not allowed by Access-Control-Allow-Origin.</p>
  </blockquote>
  
  <h1>What I've tried already:</h1>
  
  <ul>
  <li><p>Enabling Cross-Domain on SignalR on <code>Application_Start</code>:</p>
  
  <pre><code>RouteTable.Routes.MapHubs(new HubConfiguration { EnableCrossDomain = true });
  </code></pre></li>
  <li><p>Enabling Cross-Domain in the Web.Config of the SignalR server:</p>
  
  <pre><code>&lt;system.webServer&gt;
     &lt;httpProtocol&gt;
       &lt;customHeaders&gt;
         &lt;clear /&gt;
         &lt;add name="Access-Control-Allow-Origin" value="*" /&gt;
         &lt;add name="Access-Control-Allow-Methods" value="*" /&gt;
         &lt;add name="Access-Control-Allow-Headers" value="*" /&gt;
       &lt;/customHeaders&gt;
     &lt;/httpProtocol&gt;
  &lt;/system.webServer&gt;
  </code></pre></li>
  <li><p>Setting up the connection url on signalr's hub in JavaScript:</p>
  
  <pre><code>$.connection.hub.url = 'http://localhost:13370/signalr/hubs';
  </code></pre></li>
  <li><p>Enabling CORS in jQuery:</p>
  
  <pre><code>$.support.cors = true;
  </code></pre></li>
  <li><p>Setting response header manually in <code>Application_BeginRequest</code>:</p>
  
  <pre><code>protected void Application_BeginRequest(object sender, EventArgs e)
  {
      HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*");
  
      if (HttpContext.Current.Request.HttpMethod == "OPTIONS")
      {
          //These headers are handling the "pre-flight" OPTIONS call sent by the browser
          HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE");
          HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "*");
          HttpContext.Current.Response.AddHeader("Access-Control-Max-Age", "1728000");
          HttpContext.Current.Response.End();
      }
  }
  </code></pre></li>
  </ul>
  
  <h2>None of the above, nor any combination of the above has worked.</h2>
  
  <p>Additional information:</p>
  
  <ul>
  <li>Both sites are running in IIS on Windows 7</li>
  <li>The SignalR site is running on port 13370 as part of a MVC 4 site under .NET 4.0.</li>
  <li>The JS/HTML site is a simple webserver on port 13371, no managed code at all.</li>
  <li>The SignalR site will definitely respond to direct requests from the browser for the resource in question.</li>
  <li>SignalR version is 1.1.2</li>
  </ul>