6

My AWS App Runner application is running normally,

12-19-2021 05:28:15 PM [AppRunner] Service status is set to RUNNING.
12-19-2021 05:28:15 PM [AppRunner] Service creation completed successfully.
12-19-2021 05:28:14 PM [AppRunner] Successfully routed incoming traffic to application.
12-19-2021 05:27:48 PM [AppRunner] Health check is successful. Routing traffic to application.
12-19-2021 05:26:39 PM [AppRunner] Performing health check on path '/ping' and port '8081'.
12-19-2021 05:26:29 PM [AppRunner] Provisioning instances and deploying image.
12-19-2021 05:26:18 PM [AppRunner] Successfully pulled image from ECR.
12-19-2021 05:24:17 PM [AppRunner] Service status is set to OPERATION_IN_PROGRESS.
12-19-2021 05:24:16 PM [AppRunner] Service creation started.

It's an express/ws application, and it works just fine in Docker locally. I am able to reach the myapplication.com/ WebSocket endpoint when it's running locally. However, I am seemingly unable to reach the WebSocket domain when the app is running on AWS App Runner. The application runs at port 8081 internally, but of course App Runner will port that over to port 80/443 to the outside.

I can confirm that the application is running at-least partially in App Runner, since I can reach the myapplication.com/ping endpoint.

I have tried manually with JavaScript in the console to connect to the WebSocket endpoint with every combination of ws://myapplication.com/, wss://myapplication.com/, wss://myapplication.com:8081/, ws://myapplication.com:8081/ and nothing has worked.

My question is - Does App Runner even support WebSockets? I read this on the documentation of App Runner:

Stateless apps – App Runner doesn't guarantee state persistence beyond the duration of processing a single incoming web request.

This, of course, means that having a long term WebSocket client running on AWS App Runner isn't a great idea, but does it also mean that WebSockets are impossible?

1 Answers1

10

Unfortunately, AWS App Runner doesn't support WebSockets as well as sticky sessions.

Ziolek
  • 142
  • 6
  • 1
    That means Streamlit apps cannot run on AWS App Runner, because they need websockets: https://discuss.streamlit.io/t/websockets-non-negotiable/1078 . – asmaier Sep 09 '22 at 16:33