SignalR thinks request is cross domain
We faced an issue in our staging environment where SignalR thought the request was coming from another domain. So, we enabled CORS for the time being...however, we realized that we were downgraded to long polling which means we can't maintain server affinity.
We are using .NET 4 / SignalR 1.2.2 and our request goes through an F5 load balancer. We're trying to debug this issue, obtain logs and disable CORS to get exact details. I tried to map a hub with "http://domainname.com/signalr", but it didn't work. The application lanuched without complaining, but I couldn't connect to signalr anymore. Since we're on .NET 4, we can't move to using the latest version / WebSockets.
What is the best way to instruct SignalR to allow a range of domains? (I've also tried multiple calls to map hubs, but that failed).
UPDATE:
Upon further investigation, I've realized that that the application can be accessed internally and externally. SignalR seems to bind to the machine name. Hence, everything works on the local url. However, when we make a request from an external domain which the F5 load balancer forwards, SignalR thinks it's a cross-site request....which theoretically it isn't in this case.
Is it possible that this is a F5 issue?
Is there a way to ask SignalR to allow certain domains without downgrading to longPolling?
If you've implemented load balancing then you must implement scale out in SignalR
take a look at ScaleOut in SignalR One approach is ScaleOut with SQL Server : Have a look
链接地址: http://www.djcxy.com/p/62228.html上一篇: 自节点v0.12.2开始负载均衡
下一篇: SignalR认为请求是跨域