☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Bokeh script tag from server_document does not work

Community Support
jmf
jmf

I am trying the example code for embedding a bokeh server app in html using the server_document() function.

I am getting a websocket connection error

WebSocket connection to 'ws://demo.bokeh.org/sliders/ws' failed:

The html code is:

<html>
    <body>
        <script
            src="https://demo.bokeh.org/sliders/autoload.js?bokeh-autoload-element=1000&bokeh-app-path=/sliders&bokeh-absolute-url=https://demo.bokeh.org/sliders"
            id="1000">
        </script>
    </body>
</html>

any ideas?

⌁   Link to post
Bryan
Bryan

Generally speaking, anyone who deploys a Bokeh server app will want to exert control over who and where the app can be emedded, and not e.g. allow anyone in the world to directly embed their app without their permission. The demo site is not configured to allow connections like this, except from requests that have demo.bokeh.org as their ORIGIN (which will not be the case for where ever your page is hosted).

You will need to try things out with a Bokeh server that you run yourself, with --allow-websocket-origin or BOKEH_ALLOW_WS_ORIGIN configured to allow connections from your embedding origin (or "*" to open things up to any origin).

⌁   Link to post

End of archived discussion · Replies are disabled