Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable skipNegotiation setting in Blazor Server

How to enable skipNegotiation setting in Blazor Server for avoid sticky sessions

In documentation https://learn.microsoft.com/ru-ru/aspnet/core/signalr/scale?view=aspnetcore-5.0

When all clients are configured to only use WebSockets, and the SkipNegotiation setting is enabled in the client configuration

like image 479
Daniil Sokolyuk Avatar asked Dec 01 '25 20:12

Daniil Sokolyuk


1 Answers

In _Host.cshtml

<script src="_framework/blazor.server.js" autostart="false"></script>
<script>
    Blazor.start({
        configureSignalR: function (builder) {
            builder.withUrl("/_blazor", {
                skipNegotiation: true,
                transport: 1
            });
        }
    });
</script>
like image 54
Daniil Sokolyuk Avatar answered Dec 05 '25 16:12

Daniil Sokolyuk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!