简体   繁体   English

带有多个应用程序的IIS站点中的siganlr

[英]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.... 我有一个运行在IIS8中的webapp,可以说它的URL是myapp.com/,现在,该URL会将我带到login.aspx,一旦用户登录到该应用,就会有几个可以正常工作的信号中心,请求进入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). 状态 ,并将“ myapp”和“状态”的应用程序池设置为相同(我也尝试过使用单独的应用程序池)。

So I was thinking well then the requests for the sub-application hubs would be myapp.com/status/signalr.... right!?, wrong!!! 所以我想的很好,那么对子应用程序中心的请求将是myapp.com/status/signalr ....对!错了! all requests for the hubs come in as myapp.com/signalr... 对集线器的所有请求都以myapp.com/signalr的形式出现。

I have tried defining the url in app.MapSignalR(); 我已经尝试在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.... ). 并在javascript createHubProxy('myhub')函数上执行,但即使URL符合我的预期( myapp.com/status/signalr .... ),请求也不会通过。 I get negotiation error and when I debug status, the requests for signalr never reach the global.asax for status. 我收到协商错误,并且在调试状态时,对signalr的请求永远不会到达global.asax状态。

The reason for having these 2 applications under same site is 1. certificate and 2. both applications deal with the same user data. 将这两个应用程序放在同一站点下的原因是1.证书和2.两个应用程序都处理相同的用户数据。

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. 我将尝试的最后一个想法只是将状态应用程序解决方案包含到myapp解决方案中,然后将它们一起发布,这样Owin类和全局asax会在编译时合并在一起,然后问题应该消失,但是如果可以保留它们分开,那么我宁愿那样做。

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. 在应用程序中,可以根据需要定义尽可能多的Hub子类。 However, they will all use the same /signalr (or whatever custom URL you configure). 但是,它们都将使用相同的/ signalr(或您配置的任何自定义URL)。 It's not possible to have separate URLs of /signalr and /status/signalr. / signalr和/ status / signalr不可能有单独的URL。 Note that the groups for two different Hubs are kept separate, even though the Hubs share the same URL. 请注意,即使两个集线器共享相同的URL,两个集线器的组也保持分开。

You can confirm this under the "Multiple Hubs" heading on this page . 您可以在此页面上的“多个集线器”标题下进行确认。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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