小编SAN*_*ANA的帖子

connet to asp.net core signalR server from a javascript client

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 
}
Run Code Online (Sandbox Code Playgroud)

startup code for the routing :

 app.UseSignalR(routes =>
            {
                routes.MapHub<LogNotifierHub>("/NotifierHub");
            });
Run Code Online (Sandbox Code Playgroud)

javascript code for …

javascript jquery signalr asp.net-core-2.0

2
推荐指数
1
解决办法
2451
查看次数

标签 统计

asp.net-core-2.0 ×1

javascript ×1

jquery ×1

signalr ×1