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
default of browser.serverAddress is not actually "localhost" #8629
Comments
Hey @wyattscarpenter, I have just tried to reproduce it on my M1 Mac, but there it behaves correctly and I correctly see
The log lines seem to come from this method where also the IP address is determined; when no respective config options are set, it seems to jump into net_util.get_internal_ip() which seems to determine the IP address via the I don't have anything set in the |
@raethlein interesting! I'm on Windows 10 (and the same thing happens in WSL on that machine). As far as I know I'm not in a VPN, VM, or container. I'm using streamlit 1.34.0 but it's been like this since I can remember. I can connect via localhost. Looking at the method you cite, the cause is straightforward: I have server.headless set to true in the config as well. So the
as well. |
Great! |
Going to transfer this issue into the docs repo so that it's in a more correct location (Huh, looks like I can't for some reason 😕) |
I'm not sure whether or not it's a docs issue. I don't know why the server.headless setting overrides the browser.serverAddress setting. Maybe it's a good reason, since the behavior seems intentional. I could imagine that for some reason a headless server might need to output the things it currently does. But maybe not. Assuming the behavior is desirable: add note (in both places?) that server.headless overrides the browser.serverAddress setting. If the behavior isn't desirable: make it not do that, I suppose. |
good points, thanks 🙂 I guess the behavior is desirable since you can also connect via |
That seems like a pretty good solution to me. |
## Describe your changes Closes #8629 When Streamlit is started via `server.headless=true`, the address output does not contain `localhost`, although the server can still be reached via `localhost`. The `headless` mode just defines whether a browser is started, not what the address binding is. So, the idea is to show `localhost` also in case when `server.headless=true` is set. ## GitHub Issue Link (if applicable) ## Testing Plan - Explanation of why no additional tests are needed - Unit Tests (JS and/or Python) - E2E Tests - Any manual testing needed? --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
Checklist
Summary
https://docs.streamlit.io/develop/api-reference/configuration/config.toml#browser says the default of serverAddress is "localhost". However, this can't be true, because if I
streamlit run
a file withoutin the config.toml
I get something like the following:
And when I add the lines to the config.toml I get
instead. (Which is the desired behavior in my case.)
localhost:8501 works to access the application either way.
This is either a documentation issue or a true bug.
The text was updated successfully, but these errors were encountered: