I saw this stack overflow post today on how to use SignalR across domains:
Since I wanted to try out SignalR anyway I thought it would be a nice way to get started and see if I can solve the problem and write a small tutorial on how to do it.
$.connection.hub.url = 'http://[someotherdomain]/signalr';
If you try your application like this it will not work and you will have the same problem as the poster mentioned above. This is because for security reasons many browsers don’t allow cross-domain calls by default. A server has to add the special
Access-Control-Allow-Origin header to its response to tell the browser to allow cross domain calls to this specific site.
You can add this value to your ASP.NET page using:
However even with this modification SignalR won’t do the cross domain call – at least not in Internet Explorer 9 where I tested it. Like the original poster I was stuck for quite a while because I didn’t find any solutions. The error message I got was:
SignalR: Connection must be started before data can be sent. Call .start() before .send()
Poking arround the jQuery code and debugging a bit I eventually saw that there is a check inside jQuery to see if the call is a cross domain call or not and eventually this part of the code will terminate with the error “No transport”.
jQuery.support.cors = true; //force cross-site scripting
And it worked!!!
I also found some references suggesting JSONP as a possible solution, but it seems more complex and at least for me the solution above works fine.