Saturday, 17 August 2013

Failed to connect to remote server with SignalR

Failed to connect to remote server with SignalR

i have a server (WebAPi asp.net)running on IIS on one machine and another
server running on second machine (nodeJS server). the second machine
supposed to present the html files for the client. i am trying to connect
the html to the IIS - in order to recieve SignalR notifications. when all
is on one machine (IIS express) all is ok, is there a way to debug it?
$(document).ready(function() {
//var connection = $.hubConnection('http://localhost:58983');
var connection =
$.hubConnection('http://172.18.25.84/situatorwebapi');
$.connection.hub.logging = true;
var incidentHubProxy = connection.createHubProxy('notification');
connection.start()
.done(function(){
toastr.success('Now connected, connection ID=' +
connection.id);
setInterval(function() {
//console.log('ping');
incidentHubProxy.invoke('ping');
}, 3000);
incidentHubProxy.invoke('joinGroup', 'Sensor');
incidentHubProxy.invoke('joinGroup', 'Incident');
})
.fail(function(){ toastr.error('Could not connect'); });
in IE console i get CORS error
SEC7118: XMLHttpRequest for
=1376772127229">http://172.18.25.84/situatorwebapi/signalr/negotiate?=1376772127229
required Cross Origin Resource Sharing (CORS). 172.18.25.181:5000 SEC7128:
Multiple Access-Control-Allow-Origin headers are not allowed for CORS
response. 172.18.25.181:5000 SCRIPT7002: XMLHttpRequest: Network Error
0x80070005, Access is denied.
172.18.25.181:5000
my hub configuration are:
var hubConfiguration = new HubConfiguration();
hubConfiguration.EnableCrossDomain = true;
hubConfiguration.EnableDetailedErrors = true;
hubConfiguration.EnableJavaScriptProxies = false;
RouteTable.Routes.MapHubs("/signalr", hubConfiguration);

No comments:

Post a Comment