SignalR sends a message to Clients from an external application

Can I send a message to clients connected to a hub from another process? I installed LINQPad to reference the Hub project DLL and installed VS to attach debugging to the LINQPad process. My project has a HubNotification class that uses the following code:

dynamic clients = Hub.GetClients<MyHubClass>(); clients.SendMessage("My Message"); 

When debugging, I see this code being called, but my connected clients never send a message. I checked with Fiddler that the HTTP code does not happen when the above code is executed. Am I missing something or is it just not possible?

+4
source share
1 answer

This call only works if you are in the same application domain. If you want to connect to the signalr service from another process / application, you need to use the signalr client. More details here:

https://github.com/SignalR/SignalR/wiki/SignalR-Client-Hubs

+5
source

Source: https://habr.com/ru/post/1390115/


All Articles