Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the function "withStreamlitConnection" may have a problem in Remote servers #15

Open
2859135131 opened this issue Nov 24, 2023 · 3 comments

Comments

@2859135131
Copy link

It works locally and can receive data returned from React, but when you mount a web page on the server, there is no way to send audio data to streamlit on the web page, and it seems that there is a problem with the link. At present, on this web page, it is possible to obtain microphone permissions normally with https, and it is no problem to download and play, I don't understand if I need to rely on anything else to ensure the link.

@jamiesun
Copy link

I'm also experiencing this problem, what do I need to do to fix it

@ptorru
Copy link

ptorru commented Jul 11, 2024

I can confirm this is still an issue, it would be nice to have a resolution :)

@b1ck0
Copy link

b1ck0 commented Dec 3, 2024

same problem

edit:

I found a solution of the problem. When you deploy to remote server or docker container you need to edit the streamlit run command to:

ENTRYPOINT ["streamlit", "run", "main.py", "--server.enableCORS=false", "--server.enableXsrfProtection=false", "--server.port=8501", "--server.address=0.0.0.0", "--server.sslCertFile=host.cert", "--server.sslKeyFile=host.key"]

keep in mind that you disable two security features --server.enableCORS=false and --server.enableXsrfProtection=false so use this with caution.

In addition you also need to generate SSL certificate:
openssl req -x509 -newkey rsa:4096 -keyout host.key -out host.cert -days 365 -nodes
and copy both host.key and host.cert in you container/remote machine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants