I have a signalR server implemented in Dotnet Core 2.0, below is the code for the server
Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddSignalR ();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseMvc();
app.UseSignalR (routes => {
routes.MapHub <NotificationsHub> ("notificationshub");
});
}
NotificationsHub.cs
public class NotificationsHub : Hub
{
}
Then, in a controller I have got this in a GET Method (which does a bunch of stuff and then is supposed to notify clients)
_hubContext.Clients.All.InvokeAsync ("appointmentConfirmation",name,message);
Now for the .NET client (3.5) I have the following code
var APIURL = "https://localhost:11111/notificationshub"
_notificationHub = new HubConnection(APIURL, false);
_notificationProxy = _notificationHub.CreateHubProxy("NotificationsHub");
_notificationProxy.On<String,JObject>("appointmentConfirmation",
(name, message) =>
{
//
});
await _notificationHub.Start();
However, it throws an exception saying 404 Not Found
.