Using host headers with self hosted ASP.NET SignalR 2.0

0 Comments

If you want to use host headers in development with self hosted ASP .NET SignalR 2.0, you can add the hostheader to your hosts file, found in C:\Windows\System32\Drivers\etc   Then use the following adjusted client

ASP.NET SignalR self hosting: Fixing the error XMLHttpRequest cannot load http://localhost:8080/signalr/negotiate…. Origin http://localhost:52947 is not allowed by Access-Control-Allow-Origin.

6 Comments

  If you follow the tutorial http://www.asp.net/signalr/overview/getting-started/tutorial-signalr-self-host to the letter, you will end up with an error:   XMLHttpRequest cannot load http://localhost:8080/signalr/negotiate?connectionData=%5B%7B%22name%22%3A%22myhub%22%7D%5D&clientProtocol=1.3&_=1378817568655. Origin http://localhost:52947 is not allowed by Access-Control-Allow-Origin. Default.html:1   The solution can be