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

stop showing #1964

davidism opened this issue Nov 6, 2020 · 2 comments · Fixed by #2010

stop showing #1964

davidism opened this issue Nov 6, 2020 · 2 comments · Fixed by #2010


Copy link

davidism commented Nov 6, 2020

Not sure how feasible this is, but it's one of the more common questions I see on SO. Users for whatever reason run the dev server on, see Running on, then are confused when they can't get to that IP in most browsers or scripts. Maybe if Werkzeug sees that value, it displays a more helpful message with the real ip (or localhost if not possible) and a warning about running the dev server in production. Running on all interfaces (try http://{real ip}). Warning: Don't use the development server in production.

@davidism davidism added the server label Nov 6, 2020
Copy link

jab commented Nov 9, 2020

Great idea @davidism, I've seen users hit this too, and was impressed when I tried npx @11ty/eleventy --serve for the first time and saw the Browsersync output included my (LAN) external IP, in case that's helpful prior art:

[Browsersync] Access URLs:
       Local: http://localhost:8080
          UI: http://localhost:3001
 UI External: http://localhost:3001
[Browsersync] Serving files from: _site

Something like this would get us that much (based on

with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s:
        s.connect(('', 1))  # need not be reachable
        return s.getsockname()[0]
    except Exception:
        return ''

Not sure it's in scope, but if we wanted to try to get the host's WAN IP, I think we'd either have to try querying the router over UPnP, which requires a UPnP client, as in

import miniupnpc
client = miniupnpc.UPnP()
client.discoverdelay = 200
return client.externalipaddress()

...or resort to querying some public "what is my IP" service (,, etc.) as in


This comment has been minimized.

@davidism davidism added this to the 2.0.0 milestone Jan 18, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

Successfully merging a pull request may close this issue.

3 participants