Websocket State: PINGING_SERVER Event: CONNECTION_TIMED_OUT when deploying on AWS

We have a streamlit that we are trying to get working in AWS on FARGATE/ECS. Locally it works fine, but when deployed on AWS, we just get the “Please wait…” and inspection of the Developer Console reveals the Websockets errors.

We are hitting the Streamlit by IP only. We idon’t have a host name setup via Route53. We also are not using an ALB, we are just hitting the container directly. Our entry point is as follows:

ENTRYPOINT [“streamlit”, “run”, “–server.port=80”, “–server.enableCORS=false”, “–server.enableWebsocketCompression=false”]

The other config files are set to default inside the container. We disabled CORS since we have no hostname at this time. And we disabled Websocket Compression. We noticed that Safari 16.0 will actually work, but with Chrome it does not.

We do use a proxy at work (zScaler). The proxy info is being set as ARG in the Dockerfile.

Does anyone have any idea what may be stopping this from working? On the ECS task, I am using port 80.

As a test, I deployed this bypassing our proxy, and it works. So what needs to be done to make this compatible with a proxy?

I figured out what the issue was. I went to http://websocketstest.com and it showed that my company blocks WebSockets on port 80. This is probably because their proxy cannot properly handle WebSockets or is not configured properly to do so. It is allowed on 443, likely because with SSL/TLS Websockets can pass as data. So I put the Streamlit on 443 and all is well.

1 Like

Awesome! Great to hear :slight_smile: