Here are two steps to solve if you are hosting with iis server then using the Blazor server app
1> Go to Windows and serach the enter image description her (Turn windows features on or off)
2>Then select the
-> internet information services
-> World wide web services
-> Application Development Features
- WebSocket Protocol (Turn on)
if you are using the ubuntu then go to set this setting like this
location /_blazor {
proxy_pass http://localhost:5002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
}