简体   繁体   English

yarp 与 signalr .net 核心 5/6

[英]yarp with signalr .net core 5/6

I have created a basic chathub with signalr and want YARP to forward all the WS://<>/chat/ trafic to my API service;我用 signalr 创建了一个基本的聊天集,并希望 YARP 将所有 WS://<>/chat/ 流量转发到我的 API 服务; could anyway please share the YARP config file just to forward all the websocket traffic to an endpoint.无论如何,请共享 YARP 配置文件只是为了将所有 websocket 流量转发到端点。

Any pointers would help.任何指针都会有所帮助。

If you have YARP running already, just provide the config via app settings:如果您已经运行了 YARP,只需通过应用设置提供配置:

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "ReverseProxy": {
    "Routes": {
      "route1": {
        "ClusterId": "cluster1",
        "Match": {
          "Path": "/path/to/match/{*path}"
        }
      }
    },
    "Clusters": {
      "cluster1": {
        "Destinations": {
          "cluster1/destination1": {
            "Address": "http://localhost:5000/"
          }
        }
      }
    }
  }
}

If you have something a bit more concrete that you're playing with locally that is not working, please provide it here and I'll help if I can.如果您在本地玩的更具体的东西不起作用,请在此处提供,如果可以,我会提供帮助。 For more details, check out the YARP docs , the above config is mostly a copy paste of their out of the box config.有关更多详细信息,请查看YARP 文档,上述配置主要是其开箱即用配置的复制粘贴。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM