Embed server session with bokehjs

Hi,
I got a bokeh session open with:

bokeh serve --port=500 --allow-websocket-origin localhost:5010 main_backend.py

In my .html file I insert my script with:

Bokeh.embed.add_document_standalone("http://localhost:5010/main_backend")

When I want to view the session I get following error:

Is there a way to fix this?

@Julian3012 documentation for server embedding are here:

https://docs.bokeh.org/en/dev/docs/user_guide/embed.html#bokeh-applications

If you need/want to do this without a script tag for now I’d suggest you look at that autoload.js script and copy/take the parts you need. I’ve made an issue about BokehJS embedding API for server app:

It’s never really come up previously but the question has been raised a few times this month so it’s time to make some improvements.

I got a bokeh session open with:

Just to clarify terminology: just starting a bokeh server does not open any sessions, in and of itself. Sessions are only made whenever connections to the server actually come in.

1 Like