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

If ServerApp.ip is ipv6 use [::1] as local_url #1495

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

manics
Copy link
Contributor

@manics manics commented Jan 26, 2025

Currently jupyter-server always uses http://127.0.0.1:8888/?token=TOKEN as the local URL. This changes it to use [::1] if jupyter-server is configured to listen on an IPv6 IP:

$ jupyter-server --ip=::

[I 2025-01-26 13:55:09.642 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2025-01-26 13:55:09.657 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2025-01-26 13:55:09.660 ServerApp] Serving notebooks from local directory: /tmp/test
[I 2025-01-26 13:55:09.660 ServerApp] Jupyter Server 2.16.0.dev0 is running at:
[I 2025-01-26 13:55:09.660 ServerApp] http://HOSTNAME:8888/?token=TOKEN
[I 2025-01-26 13:55:09.660 ServerApp]     http://[::1]:8888/?token=TOKEN
[I 2025-01-26 13:55:09.660 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 2025-01-26 13:55:09.661 ServerApp] Welcome to Project Jupyter! Explore the various tools available and their corresponding documentation. If you are interested in contributing to the platform, please visit the community resources section at https://jupyter.org/community.html.
[C 2025-01-26 13:55:09.664 ServerApp] 
    
    To access the server, open this file in a browser:
        file:///tmp/test/jpserver-1134488-open.html
    Or copy and paste one of these URLs:
        http://HOSTNAME:8888/?token=TOKEN
        http://[::1]:8888/?token=TOKEN

jupyter_server/serverapp.py Outdated Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

1 participant