question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make it possible to use relative URLs

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
havocpcommented, Feb 6, 2017

if removing --host btw it might be friendly to accept it and do nothing (maybe with deprecation message) rather than throwing an error.

0reactions
dhuebnercommented, Feb 7, 2017

@bryevdv @havocp Thanks for your comments and for the great work. Using relative URLs plus remove the host header will make bokeh setup very easy. Looking forward to test it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Absolute vs relative URLs - Stack Overflow
Although relative URL look shorter than absolute one, but the absolute URLs are more preferable, since a link can be used unchanged on...
Read more >
How to link pages using relative URL in HTML? - Tutorialspoint
Relative URLs don't contain full web address. With relative URL we start automatically from the address the browser currently at then we add ......
Read more >
HTML and URLs
HTML documents utilize URLs for specifying hypertext links. The following provides a brief ... Relative URLs are resolved to full URLs using a...
Read more >
Absolute vs Relative URLs: Which Format is Best for Your ...
A relative URL provides only the tag of an absolute URL. If you want to link to a product page from a category...
Read more >
Absolute vs Relative URLs: when to use which for SEO?
For faster and more effective coding, we recommend relative URLs. Rather than including the entire URL for each page you link, relative URLs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found