ASP.NETCore Signalr not work on AWS

2019-05-01 06:27发布

问题:

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.

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.

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 ()

回答1:

It's a CloudFlare which closes your connection after 60 seconds. You should ping to keep the connection open.