def public_host(app):
    """Return the public *host* (no URL prefix) of the given JupyterHub instance."""
    if app.subdomain_host:
        return app.subdomain_host
    else:
        return Server.from_url(app.proxy.public_url).host
Return the public *host* (no URL prefix) of the given JupyterHub instance.
jupyterhub/tests/utils.py