I have the following setup:
- A hub installed on two servers.
- A load balancer that redirects the connection to one of the two servers.
- A Delphi desktop application using the EseCeGe libraries as a client that connects to the hub:
If I connect directly to one of the servers, it works correctly.
If I connect to the load balancer, it fails to connect.
I have another application in .NET, and it connects correctly when connected to the load balancer.
I use those classes:
...Create(const AURL, AHub: string);
begin
WsClient := TsgcWebSocketClient.Create( nil );
SignalR := TsgcWSAPI_SignalRCore.Create( nil );
SignalR.Client := WSClient;
WSClient.URL := AURL;
SignalR.SignalRCore.Hub := AHub;
SignalR.SignalRCore.Authentication.Enabled := True;
SignalR.SignalRCore.Authentication.TokenParam := srctHeader;
SignalR.SignalRCore.Authentication.Authentication := srcaSetToken;
end;
I have auth by JWT
....BeforeConnect;
begin
SignalR.SignalRCore.Authentication.SetToken.Token := AuthenticationTokenManager.GetToken;
end;
If you have any similar cases with a load balancer and know if any properties might be missing, please let me know.
Or if any properties in your libraries could be specified for these cases.
I'm sorry but I've never tested signalr through a Load balancer, it should work without changes but maybe it requires an extra configuration.
Please enable the Log property in the TsgcWebSocketClient and send me the log file with a successful connection when connecting directly to the server and when fails connecting to the load balancer.
If you can provide the logs of a successful connection using the .net client to the load balancer it will help too.