SignalR client receives Information: Connection disconnected from hub

157 Views Asked by At

I created a signalR JavaScript client that needs to communicate with a hosted signalR server (from Playfab). I successfully created the signalR client and connected it with the server, but the problem that I'm facing is that the connection doesn't stay open more than 30 seconds even though I subscribe to events.

Here are the messages between the client and server. After one ping, the server sends a close message. Messages between client and server

How can I prevent this from happening?

Here is how the connection is created

connection = new signalR.HubConnectionBuilder()
 .withUrl(`url`, {
   withCredentials: false,
   httpClient: new SignalRClient(),
   headers: {
     'X-EntityToken': entity.EntityToken,
   },
 })
 .build()
await connection.start()
0

There are 0 best solutions below