ASP.NETCore Signalr 在 AWS 上不起作用 [英] ASP.NETCore Signalr not work on AWS
问题描述
我们有两个应用程序,服务器端 (.Net Core 2.0) 和客户端 (AngulerJs),它们托管在 AWS elistic 容器服务上,此外,还有一层云耀斑,此外,我们使用的是指向我们的 docker 容器的 ALB.
We have two applications, server-side (.Net Core 2.0) and client side (AngulerJs) that they are hosted on AWS elistic container service, also, there is a layer of cloud flare, in addition, we are using an ALB that is pointing to our docker containers.
我们的解决方案应该有一个将数据推送到客户端的实时服务,因此我们为此使用了 asp net core signalr version = "1.0.0-alpha2-final".
Our solution should have a real time services which pushs data to the client side, so we used asp net core signalr version = "1.0.0-alpha2-final" for this purpose.
问题是,当我们在 localhost 中测试信号器时,它工作正常,但是当在 AWS 中托管应用程序时,它会工作 1 分钟左右,然后它抛出错误:Websocket 关闭,状态码:1006 ()
The problem is, the signalr is working fine when we test it in localhost but when host the applications in the AWS it works for 1 minute or so and then it throw error: "Websocket closed with status code: 1006 ()
推荐答案
这是一个 CloudFlare,它会在 60 秒后关闭您的连接.您应该 ping 以保持连接打开.
It's a CloudFlare which closes your connection after 60 seconds. You should ping to keep the connection open.
这篇关于ASP.NETCore Signalr 在 AWS 上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!