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

Merged
merged 2 commits into from
Feb 6, 2025

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
Copy link
Contributor

@afshin afshin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@afshin afshin merged commit edb2f1b into jupyter-server:main Feb 6, 2025
37 of 38 checks passed
@manics manics deleted the localurl-ipv6 branch February 6, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants