http requests connect, but websockets do not when running inside docker
See original GitHub issueSummary
When running streamlit hello
inside a docker container, I am able to connect to the web server, but none of the web socket requests succeed. This occurs in both docker and kubernetes.
Steps to reproduce
running the Dockerfile
:
FROM ubuntu:latest
RUN pip3 install streamlit
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN mkdir -p /root/.streamlit/
RUN echo '[general]\nemail = "a@a.a"' > /root/.streamlit/credentials.toml
CMD streamlit hello
run docker run -p 8501:8501 --rm -it streamlit
Debug info
- Streamlit version: 0.47.4
- Python version: 3.6.8
- Using Conda? PipEnv? PyEnv? Pex? no
- OS version: ubuntu:latest
- Browser version: Chrome Version 76.0.3809.132
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How do you dockerize a WebSocket Server? - Stack Overflow
Your server needs to listen on it's external interface, not localhost. Try changing localhost:8000 in the server code to 0.0. 0.0:8000 .
Read more >Connection refused? Docker networking and how it impacts ...
Learn how to fix connection refused errors when trying to connect to a Docker container.
Read more >Replicator does not connect to endpoint when run in Docker ...
I'm writing a Java app that will be responsible for doing some work and persisting that work to the database. The app is...
Read more >25. WebSocket Support - Spring
This part of the reference documentation covers Spring Framework's support for WebSocket-style messaging in web applications including use of STOMP as an ...
Read more >Troubleshooting connection issues | Socket.IO
If that's not the case, please check that the Socket.IO server is running, and that there is nothing in between that prevents the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems that adding the following into
~/.streamlit/config.toml
did the trick.Still, it would be nice not to have to do this, or to get an error message that might suggest it.
Closing since fix has been merged: https://github.com/streamlit/streamlit/pull/965 Please reopen if this is not the case.