Skip to content

Make it possible to use relative URLs  #5692

@dhuebner

Description

@dhuebner

I'm trying to get bokeh running in a docker/docker-swarm behind a nginx with path to port mapping.
Unfortunately bokeh produces full URL's when creating links which doesn't work in my case.

Starting bokeh with:
bokeh serve untitled.py --host=* --disable-index-redirect

And accessing it over:
https://my.bokeh.server:8443/9335bf292e454cf8ba1181befd4d4a99/p5006/

Produce links like the following:
<link rel="stylesheet" href="http://127.0.0.1:5006/static/css/bokeh.min.css?v=7246afcfffc127faef7c138bce4742e9" type="text/css" />

I've tried setting the explicit --host and also tried the --prefix option, both doesn't fit my requirements. What would work is a possibility to switch using relative URL's. Means instead of http://127.0.0.1:5006/static/ use ./static/ or even better static/. This is the same approach that shiny Apps are using.
For the websocket it could be calculated on the client side

      var protocol = 'ws:';
      if (window.location.protocol === 'https:')
        protocol = 'wss:';
       // TODO check for '/' in pathname and pathname is not already decoded
      var defaultPath = window.location.pathname  + '/websocket/';
      var ws = new WebSocket(protocol + '//' + window.location.host + defaultPath);

So my enhancement is:
Please, make it possible to enable relative URL generation. For example with --use-relative-urls

See also https://groups.google.com/a/continuum.io/forum/#!topic/bokeh/lIrCvXZE18M

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions