'SignalR TypeError: Failed to fetch after deploying to Azure

I am trying to create a small chat app using SignalR. In my backend I am using .net Core 5 and in Frontend, I am using React. When running in localhost every thing is working fine and there is not any connection error, but when deploying application to live server on azure, signalR don't connect at all because of this error: enter image description here

I tried to enabling "skipNegotiation" using code below but error does not solved.

const newConnection: any = new HubConnectionBuilder()
  .withUrl(AppConsts.remoteServiceBaseUrl + '/chat?' + query,{
    skipNegotiation: true,
    transport: HttpTransportType.WebSockets
  })
  .build();

What can I do to solve this problem?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source