-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[Bug]: /proxy/<port>/
does not work (at least for Streamlit and Vaadin apps)
#5657
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
Comments
Apologies, it's been a while since I've done much python. Here's what I'm doing:
import streamlit as st
st.write(f"Screen width is {streamlit_js_eval(js_expressions='screen.width', key = 'SCR')}")
Output: Traceback (most recent call last):
File "hello.py", line 1, in <module>
import streamlit as st
ModuleNotFoundError: No module named 'streamlit' Though, I do know the python3 -m http.server |
Sorry. You need Given your example above, and also examples in the website which are React, VueJS, ..., can I assume that this (immensely useful) feature works only for static hosts, i.e. when your program is fully client-side? I have also tried a Vaadin web application and failed in a similar way (i.e. URLs with |
/proxy/<port>/
does not work/proxy/<port>/
does not work (at least for Streamlit and Vaadin apps)
AH! Thank you! I'm going to blame my lack of Python knowledge and possibly my local environment but even doing that, it was not successful: ❯ pip3 install streamlit
Requirement already satisfied: streamlit in /usr/local/lib/python3.10/site-packages (1.13.0)
Requirement already satisfied: packaging>=14.1 in /usr/local/lib/python3.10/site-packages (from streamlit) (21.3)
Requirement already satisfied: cachetools>=4.0 in /usr/local/lib/python3.10/site-packages (from streamlit) (5.2.0)
Requirement already satisfied: python-dateutil in /usr/local/lib/python3.10/site-packages (from streamlit) (2.8.2)
Requirement already satisfied: pydeck>=0.1.dev5 in /usr/local/lib/python3.10/site-packages (from streamlit) (0.8.0b4)
Requirement already satisfied: pyarrow>=4.0 in /usr/local/lib/python3.10/site-packages (from streamlit) (9.0.0)
Requirement already satisfied: pympler>=0.9 in /usr/local/lib/python3.10/site-packages (from streamlit) (1.0.1)
Requirement already satisfied: altair>=3.2.0 in /usr/local/lib/python3.10/site-packages (from streamlit) (4.2.0)
Requirement already satisfied: rich>=10.11.0 in /usr/local/lib/python3.10/site-packages (from streamlit) (12.6.0)
Requirement already satisfied: blinker>=1.0.0 in /usr/local/lib/python3.10/site-packages (from streamlit) (1.5)
Requirement already satisfied: validators>=0.2 in /usr/local/lib/python3.10/site-packages (from streamlit) (0.20.0)
Requirement already satisfied: tornado>=5.0 in /usr/local/lib/python3.10/site-packages (from streamlit) (6.2)
Requirement already satisfied: importlib-metadata>=1.4 in /usr/local/lib/python3.10/site-packages (from streamlit) (5.0.0)
Requirement already satisfied: tzlocal>=1.1 in /usr/local/lib/python3.10/site-packages (from streamlit) (4.2)
Requirement already satisfied: protobuf!=3.20.2,<4,>=3.12 in /usr/local/lib/python3.10/site-packages (from streamlit) (3.20.3)
Requirement already satisfied: requests>=2.4 in /usr/local/lib/python3.10/site-packages (from streamlit) (2.28.1)
Requirement already satisfied: gitpython!=3.1.19 in /usr/local/lib/python3.10/site-packages (from streamlit) (3.1.29)
Requirement already satisfied: semver in /usr/local/lib/python3.10/site-packages (from streamlit) (2.13.0)
Requirement already satisfied: toml in /usr/local/lib/python3.10/site-packages (from streamlit) (0.10.2)
Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.10/site-packages (from streamlit) (9.2.0)
Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.10/site-packages (from streamlit) (8.1.3)
Requirement already satisfied: numpy in /usr/local/lib/python3.10/site-packages (from streamlit) (1.23.2)
Requirement already satisfied: pandas>=0.21.0 in /usr/local/lib/python3.10/site-packages (from streamlit) (1.4.3)
Requirement already satisfied: typing-extensions>=3.10.0.0 in /usr/local/lib/python3.10/site-packages (from streamlit) (4.3.0)
Requirement already satisfied: jsonschema>=3.0 in /usr/local/lib/python3.10/site-packages (from altair>=3.2.0->streamlit) (4.16.0)
Requirement already satisfied: toolz in /usr/local/lib/python3.10/site-packages (from altair>=3.2.0->streamlit) (0.12.0)
Requirement already satisfied: entrypoints in /usr/local/lib/python3.10/site-packages (from altair>=3.2.0->streamlit) (0.4)
Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/site-packages (from altair>=3.2.0->streamlit) (3.1.2)
Requirement already satisfied: gitdb<5,>=4.0.1 in /usr/local/lib/python3.10/site-packages (from gitpython!=3.1.19->streamlit) (4.0.9)
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.10/site-packages (from importlib-metadata>=1.4->streamlit) (3.9.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.10/site-packages (from packaging>=14.1->streamlit) (3.0.9)
Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/site-packages (from pandas>=0.21.0->streamlit) (2022.2.1)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/site-packages (from python-dateutil->streamlit) (1.16.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/site-packages (from requests>=2.4->streamlit) (2022.6.15)
Requirement already satisfied: charset-normalizer<3,>=2 in /usr/local/lib/python3.10/site-packages (from requests>=2.4->streamlit) (2.1.1)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/site-packages (from requests>=2.4->streamlit) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/site-packages (from requests>=2.4->streamlit) (1.26.12)
Requirement already satisfied: commonmark<0.10.0,>=0.9.0 in /usr/local/lib/python3.10/site-packages (from rich>=10.11.0->streamlit) (0.9.1)
Requirement already satisfied: pygments<3.0.0,>=2.6.0 in /usr/local/lib/python3.10/site-packages (from rich>=10.11.0->streamlit) (2.13.0)
Requirement already satisfied: pytz-deprecation-shim in /usr/local/lib/python3.10/site-packages (from tzlocal>=1.1->streamlit) (0.1.0.post0)
Requirement already satisfied: decorator>=3.4.0 in /usr/local/lib/python3.10/site-packages (from validators>=0.2->streamlit) (5.1.1)
Requirement already satisfied: smmap<6,>=3.0.1 in /usr/local/lib/python3.10/site-packages (from gitdb<5,>=4.0.1->gitpython!=3.1.19->streamlit) (5.0.0)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/site-packages (from jinja2->altair>=3.2.0->streamlit) (2.1.1)
Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /usr/local/lib/python3.10/site-packages (from jsonschema>=3.0->altair>=3.2.0->streamlit) (0.18.1)
Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python3.10/site-packages (from jsonschema>=3.0->altair>=3.2.0->streamlit) (22.1.0)
Requirement already satisfied: tzdata in /usr/local/lib/python3.10/site-packages (from pytz-deprecation-shim->tzlocal>=1.1->streamlit) (2022.5)
[notice] A new release of pip available: 22.2.2 -> 22.3
[notice] To update, run: /usr/local/opt/[email protected]/bin/python3.10 -m pip install --upgrade pip Traceback (most recent call last):
File "hello.py", line 1, in <module>
import streamlit as st
ModuleNotFoundError: No module named 'streamlit' It's fine though, we should be able to figure this out still.
Hmm..I feel like it should work regardless of static vs dynamic host? 🤔 cc @code-asher who may know of any limitations |
Oops! It seems that |
Weird, I guess somehow It is not clear to me why |
Actually that would not explain it because |
I was not able to reproduce the colon (it looks like it is evaluating the JS but not sure how that would happen) but for anyone curious the served HTML looks like this:
The behavior of
|
Uhh nevermind I am being dumb, a proxied application at the root would only see I guess to summarize all the noise I just put down this seems to be working as intended. 😆 |
Woohoo! Thanks @code-asher for diving in 🙌🏼 @aghasemi can we close this now? |
Closing since it appears the proxy is working as it should. There is an open feature request for |
Is there an existing issue for this?
OS/Web Information
code-server --version
: 4.7.1Steps to Reproduce
streamlit run example.py
myCodeServer/proxy/8501
Expected
The app should run.
Actual
There is just a blank screen with Streamlit loading title.
Logs
No response
Screenshot/Video
On the server, logs look normal.
On the client (browser), if you open the JS console, you see errors in the form of
, where I believe the part with the colon is the culprit.
Is there anything else I need to do to make this work? I just followed the steps in .
Many thanks
Best
Does this issue happen in VS Code or GitHub Codespaces?
Are you accessing code-server over HTTPS?
Notes
No response
The text was updated successfully, but these errors were encountered: