I have multiple Web apps using SignalR, generating different local hubs.
I was wondering, would it be possible to give the server URL to the application A so it generates the local SignalR hubs directly on the centralised server, so then the application B could reference the generated hubs directly from the server, instead of creating a proxy on the application B to listen to the the application A broadcast?
public class ApplicationA : Hub //https://applicationAurl
{
public void SendFromApplicationA(string name, string message)
{
Clients.All.addMessage(name, message);
}
}
public class ApplicationB : Hub //https://applicationBurl
{
public void SendFromApplicationB(string name, string message)
{
Clients.All.addMessage(name, message);
}
}
So if these hubs were created on the server instead of the mother app, the application C should be able to listen to both on the client side, like something below.
$.connection.hub.url = "http://centralisedserver/signarl";
$.connection.hub.start();
var SendFromApplicationAHub= $.connection.applicationA;
SendFromApplicationAHub.client.SendFromApplicationA = function () {//do something}
var SendFromApplicationBHub= $.connection.applicationB;
SendFromApplicationBHub.client.SendFromApplicationB = function () {//do something}