1

I have two web applications in one solution. Lets say they are accessible with these URLs: localhost:1111, localhost:2222.

I have users that can login to both applications, and both applications use same messaging mechanism, same message database.

In messaging mechanism, I use SignalR and show a popup notification about message (just like in any mail client, visually).

When a user messages to other user within same application (e.g localhost:1111 or localhost:2222 doesn't matter), message is sent correctly. This is how I did that, just like in any SignalR template code:

public void NotifyUser(string userId, string message) {
    var context = GlobalHost.ConnectionManager.GetHubContext<MyHub>();
    context.Clients.User(userId).notify(message);
}

However, when I send messages from User A browsing localhost:1111 to User B browsing localhost:2222, messages don't reach.

  1. Is this a normal behaviour? Am I expecting too much from SignalR?
  2. If this issue can be solved, how can I do that? Which point I am missing about SignalR?

Thank you all in advance.

Görkem Özer
  • 504
  • 5
  • 13
  • 1
    Have you enabled CORS in each application for the other? Although they are in the same domain (localhost), they run under different ports, so the requests might be blocked by the Same Origin Policy. https://stackoverflow.com/a/19966772/2851870 – Tasos K. Jul 29 '17 at 17:26

0 Answers0