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信号器版本= 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屋!