1

We are attempting to deploy a SignalR site on a Citrix NetScaler, as opposed to the current deployment on a single server. There are three servers in the farm. If you navigate to any single server, SignalR comes up fine. If you go to the NetScaler address, you get this:

WebSocket connection to 'wss://mysite.com/myapp/signalr/connect?transport=webSockets&clientProtocol=1.5&connectionToken=(token_displayed_here)' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET

After this error, there is about a 10-15 second delay, then it starts working. If I attempt to disable websockets as I have read that Netscalers still have issues with them, the error goes away but the delay remains. I believe the delay is caused by it trying to connect with ServerSentEvents and failing that as well. It appears that only long polling may be working over the NetScaler.

We have checked the NetScaler websocket settings, made sure the servers have the correct machine keys, had a backplane set up (tried Redis and an Oracle Nuget package as that's our typical DB), checked the OWIN versions and web.config settings, all of the stuff that Google told me to do that I could find but still get this error and delay. One thing that I did find is that Netscalers have issues with wss, but haven't been able to find anything about how to account for this. Most of the information found was for people using other load balancing technology.

Is using SignalR (or more specifically, WebSockets or ServerSentEvents) with a NetScaler even doable, and if so what could be causing this problem?

SausageBuscuit
  • 1,226
  • 2
  • 20
  • 34
  • 1
    I believe you're facing [this same problem](https://stackoverflow.com/questions/38650662/signalr-2-2-and-arr3-0-load-balancing/43479474#43479474). Check if my answer in that link helps you. – Alisson Reinaldo Silva Jun 19 '18 at 13:20
  • @Alisson I had actually seen your post previously, but wasn't able to interpret something you said. The machine keys are the same so that shouldn't be it, but you state "If the selected option is Application user, then you need to check how is your Application Pool configured". My app would be configured to use the application user. Could you elaborate on what you mean here? – SausageBuscuit Jun 19 '18 at 13:28
  • Let's suppose you have 3 servers. Each server has its own IIS running the same application, and they have their own ApplicationPools. What is the user running the ApplicationPool? Is it **ApplicationPoolIdentity** or **NetworkService**? – Alisson Reinaldo Silva Jun 19 '18 at 13:36
  • They are each set to ApplicationPoolIdentity – SausageBuscuit Jun 19 '18 at 13:40
  • Can you create one single user in your domain with access to your three servers, and change each application pool (in each server) to use a custom account rather than `ApplicationPoolIdentity`? In the custom account, you specify this same user for each application pool. – Alisson Reinaldo Silva Jun 19 '18 at 13:44
  • Tried setting this user to the app pool, the app, and to both, still getting the same error. Do you recall how you saw that your underlying error was "The connection id is in the incorrect format"? – SausageBuscuit Jun 19 '18 at 14:17

0 Answers0