SignalR client receives Information: Connection disconnected from hub
Gloria Stanciu
1
Reputation point
Hi everyone,
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.
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()
Sign in to answer