简体   繁体   中英

siganlr in IIS site with multiple applications

first timer here...

I am in a bit of a pickle and I hope someone can help. I have a webapp running in IIS8 lets say its url is myapp.com/ now this url will take me to the login.aspx, once the user has logged in to the app there are a couple of signalr hubs which work fine, the requests come in as myapp.com/signalr....

Now the problem is when I add an application to the site which also has some signalr hubs(no login required). When I added the application i gave it an alias eg. status and I set the application pool to be the same for both "myapp" and "status"(I have also tried with separate application pools).

So I was thinking well then the requests for the sub-application hubs would be myapp.com/status/signalr.... right!?, wrong!!! all requests for the hubs come in as myapp.com/signalr...

I have tried defining the url in app.MapSignalR(); and at the javascript createHubProxy('myhub') function but even then the requests dont come through, even if the url is as i expected( myapp.com/status/signalr.... ). I get negotiation error and when I debug status, the requests for signalr never reach the global.asax for status.

The reason for having these 2 applications under same site is 1. certificate and 2. both applications deal with the same user data.

The last idea I will try is simply include the status app solution into the myapp solution and publish both together that way the Owin classes and global asax will be merged together when compiled and then the problem should go away however if it is possible to keep them separate then I would much rather do that.

is this possible? and whats the procedure or do I have to have a separate site for each application?

thanx in advance :)

In an application, you can define as many Hub subclasses as you want. However, they will all use the same /signalr (or whatever custom URL you configure). It's not possible to have separate URLs of /signalr and /status/signalr. Note that the groups for two different Hubs are kept separate, even though the Hubs share the same URL.

You can confirm this under the "Multiple Hubs" heading on this page .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM