4

Note from maintainers: This question as originally posed is in regards to the first generation Bokeh server which no longer exists. For information about running modern Bokeh server applications, see Running A Bokeh Server in the docs.


I want to set up an interactive bokeh app, which can be accessed by anyone over the internet.

For understanding, how this works, I am currently trying to get the stocks example running, such that I can access it, for example, from my mobile phone.

I have already tried the following:

  • opened port 5006 and 5050 and tried to access the App over http:\\<my_global_ip>:<port>
  • studied the html source of http://docs.bokeh.org/en/latest/docs/server_gallery/stocks_server.html and figure out what's the difference of that source to the generated source code

So far I got the whole example running on the computer, where the bokeh server is running, such that I can access it via localhost:5006/bokeh/stocks/ and localhost:5050/. But as soon as I try to access it from another machine, I see the html content, but not the plot.

Edit: I'm trying to run the example at https://github.com/bokeh/bokeh/tree/master/examples/deploy because it sounds promising, but because I do not really understand what I'm doing here I would appreciate clarification. I don't get the example working, anyhow. Installation of gunicorn with conda only worked after some headaches and finally the provided commands run, but I do not get any response on port 5006 or port 7001. Perhaps I'm just misunderstanding the example?

bigreddot
  • 33,642
  • 5
  • 69
  • 122
BR123
  • 322
  • 3
  • 16
  • If you know a little Django you can put a simple page using [this example](http://stackoverflow.com/questions/29508958/how-to-embed-bokeh-graphs-into-django-templates-without-using-the-bokeh-server/29524050#29524050) – iMitwe Sep 18 '15 at 13:02
  • 1
    Thanks! Embedding will be my next step. For now I'm happy with just the bokeh content (without costum html content) being available in the internet. – BR123 Sep 19 '15 at 09:15

1 Answers1

3

Modern Bokeh versions:

You need to specify what websocket origins are permitted to connect:

https://docs.bokeh.org/en/latest/docs/user_guide/server.html#websocket-origin

E.g.

bokeh serve --show --allow-websocket-origin=foo.com sliders.py

For Bokeh version 0.11

Due to changes in the bokeh server now you need to call

bokeh serve sliders.py --host <globalip>:5006

Nothing else is needed.

Please note that you have to change the code for your app as well!

See https://github.com/bokeh/bokeh/blob/master/examples/app/sliders.py for the updated sliders app.

bigreddot
  • 33,642
  • 5
  • 69
  • 122
BR123
  • 322
  • 3
  • 16
  • Hi, have you configured your own Linux server? Do you know how `bokeh serve sliders.py --host :5006` would work on services like Heroku or PythonAnywhere? – multigoodverse Jul 17 '16 at 11:50
  • @adi I only used my own Linux server. Therefore: No clue about Heroku and PythonAnywhere, sorry. – BR123 Jul 31 '16 at 15:30