diff --git a/jupyterhub/app.py b/jupyterhub/app.py index 0348c065..4e91d87a 100644 --- a/jupyterhub/app.py +++ b/jupyterhub/app.py @@ -421,9 +421,18 @@ class JupyterHub(Application): help="Supply extra arguments that will be passed to Jinja environment." ).tag(config=True) - proxy_class = Type(ConfigurableHTTPProxy, Proxy, - help="""Select the Proxy API implementation.""" - ).tag(config=True) + proxy_class = EntryPointType( + default_value=ConfigurableHTTPProxy, + klass=Proxy, + help="""The class to use for configuring the JupyterHub proxy. + + Should be a subclass of :class:`jupyterhub.proxy.Proxy`. + + .. versionchanged:: 1.0 + proxies may be registered via entry points, + e.g. `c.JupyterHub.proxy_class = 'traefik'` + """ + ).tag(config=True) proxy_cmd = Command([], config=True, help="DEPRECATED since version 0.8. Use ConfigurableHTTPProxy.command", diff --git a/setup.py b/setup.py index 0f7a9c15..b085bce5 100755 --- a/setup.py +++ b/setup.py @@ -112,6 +112,10 @@ setup_args = dict( 'pam = jupyterhub.auth:PAMAuthenticator', 'dummy = jupyterhub.auth:DummyAuthenticator', ], + 'jupyterhub.proxies': [ + 'default = jupyterhub.proxy:ConfigurableHTTPProxy', + 'configurable-http-proxy = jupyterhub.proxy:ConfigurableHTTPProxy', + ], 'jupyterhub.spawners': [ 'default = jupyterhub.spawner:LocalProcessSpawner', 'localprocess = jupyterhub.spawner:LocalProcessSpawner',