Proxy SignalR -- document how

See original GitHub issue

Using Yarp proxy SignalR, I frequently encounter connection failures, about 10 requests out of 3 failed, but ocelot did not encounter this situation

Below is my routing configuration

{
    "Routes": {
        "SignalRRoute": {
            "ClusterId": "SignalRCluster",
            "CorsPolicy": "CorsPolicy",
            "AuthorizationPolicy": "JwtPolicy",
            "Match": {
                "Path": "/BaizeHub/{*any}"
            },
            "Transforms": [
                {
                    "PathRemovePrefix": "/BaizeHub"
                },
                {
                    "RequestHeadersCopy": "true"
                },
                {
                    "RequestHeaderOriginalHost": "true"
                },
                {
                    "RequestHeader": "Upgrade",
                    "Set": "WebSocket"
                },
                {
                    "RequestHeader": "Connection",
                    "Set": "Upgrade"
                },
                {
                    "X-Forwarded": "Set",
                    "For": "Append",
                    "Proto": "Append",
                    "Prefix": "Append",
                    "HeaderPrefix": "X-Forwarded-"
                }
            ]
        }
    },
    "Clusters": {
        "SignalRCluster": {
            "LoadBalancingPolicy": "PowerOfTwoChoices",
            "Destinations": {
                "Message/Destination1": {
                    "Address": "https://172.30.50.13:5400"
                },
                "Message/Destination2": {
                    "Address": "https://172.30.50.12:5400"
                }
            },
            "HttpClient": {
                "DangerousAcceptAnyServerCertificate": true
            },
            "HttpRequest": {
                "Version": "1.1",
                "Timeout": "00:10:00"
            },
            "HealthCheck": {
                "Active": {
                    "Enabled": "true",
                    "Interval": "00:00:10",
                    "Timeout": "00:00:10",
                    "Policy": "ConsecutiveFailures",
                    "Path": "/Health"
                },
                "Passive": {
                    "Enabled": true,
                    "Policy": "TransportFailureRate",
                    "ReactivationPeriod": "00:00:10"
                }
            }
        }
    }
}
  • Yarp.ReverseProxy 1.0.0-preview.12.21328.2
  • Linux

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:25 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
zqlovejyccommented, Jul 21, 2021

Are sticky sessions enabled?

not enabled

0reactions
Lukejkwcommented, Jan 26, 2022

I’m referring to the kubernetes service which acts as a load balancer between pods. Session affinity can be set there too so that might be the ticket.

Thanks so much for the help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ASP.NET SignalR Hubs API Guide - JavaScript Client
What the proxy does for you is simplify the syntax of the code you use to connect, write methods that the server calls,...
Read more >
ASP.NET SignalR Hubs API Guide - Server (C#)
This document provides an introduction to programming the server side of the ASP.NET SignalR Hubs API for SignalR version 2, ...
Read more >
Using SignalR client through a web proxy
Seriously, this is a real issue, and a real question! I would like this answered. How the heck do you set up SignalR...
Read more >
How To Enable SignalR for Angular Dev Server : r/dotnet
Following advise on the internet, you'd find you have to edit the Angular proxy.conf.js (added by the VS template) to add any urls...
Read more >
Creating Manual Javascript SignalR Client
In this article you will learn how to create a manual SignalR client in JavaScript without using the generated JavaScript proxy.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found