I have asp.net core web api server that is streaming a signalr, And it works for asp.net client , I am trying to make a connection with the code showen beelow but it only connects to a none core servers it wouldnt work for the core servers.
//the hub class in the server code
[EnableCors("AllowAllOrigins")]
[HubName("LogNotifierHub")]
public class LogNotifierHub : Hub
{
//methods defined here
}
startup code for the routing :
app.UseSignalR(routes =>
{
routes.MapHub<LogNotifierHub>("/NotifierHub");
});
javascript code for making the connection
var hubUrl ="http://localhost:52273/logNotifierHub";
var connection = $.hubConnection(hubUrl, { useDefaultPath: true});
var hub = connection.createHubProxy("LogNotifierHub");
hub.on('SendStreamInit', function(data){
console.log( data)
})
connection.start()
.done(function(){ console.log(' connected!! connection ID=' + connection.id); })
.fail(function(error){ console.log('Could not connect!!' + error); });
;'s in your js. Futhermore: do you receive errors when trying to connect? If so, post them please. - Stefan;are inferred in js - but sometimes the infer gets it wrong. - freedomn-m