Bokeh server with network restrictions (websockets blocked)

Hello,

I have a very restrictive work/corporate network. I am attempting to run a Bokeh (v2.02) server off-network (cloud-hosted), and was successful (using either standalone or embedded in Flask applications) when accessing from off-network browsers. However, when I try to access the URL from my work network, I get a blank page, then after several seconds the console reports errors in opening websocket connections. The Bokeh server output does not report a websocket connection registered, but with debug logging I see that it discards a session after one or two seconds.

I am wondering if there is any work-around to be able to display a working app running on a Bokeh server from an on-network browser. The option to configure the proxy or firewall settings on-network is impossible. Do you think there is any way around this (networking setup, or websocket-free server options)?

I haven’t included the actual app code but I re-iterate that it is running successfully and can be accessed from a variety of other computers/networks at the same URL that it fails on the work network.

As an aside, I have written standalone pages using CustomJS routines to share single documents on-network, and they have been well-received, so I really appreciate all of the efforts in the community to put out and support a great library. If I were able to share products with actual Python callbacks, it would be open a lot of possibilities!

Thanks very much,
Andrew

Bokeh server output:

2020-06-12 16:41:28,530 Starting Bokeh server version 2.0.2 (running on Tornado 6.0.4)
2020-06-12 16:41:28,531 User authentication hooks NOT provided (default user enabled)
2020-06-12 16:41:28,531 These host origins can connect to the websocket: ['localhost:5006']
2020-06-12 16:41:28,531 Patterns are:
2020-06-12 16:41:28,532   [('/armax_bokeh/?',
2020-06-12 16:41:28,532     <class 'bokeh.server.views.doc_handler.DocHandler'>,
2020-06-12 16:41:28,532     {'application_context': <bokeh.server.contexts.ApplicationContext object at 0x7fa3eaaba240>,
2020-06-12 16:41:28,532      'bokeh_websocket_path': '/armax_bokeh/ws'}),
2020-06-12 16:41:28,532    ('/armax_bokeh/ws',
2020-06-12 16:41:28,532     <class 'bokeh.server.views.ws.WSHandler'>,
2020-06-12 16:41:28,532     {'application_context': <bokeh.server.contexts.ApplicationContext object at 0x7fa3eaaba240>,
2020-06-12 16:41:28,532      'bokeh_websocket_path': '/armax_bokeh/ws'}),
2020-06-12 16:41:28,532    ('/armax_bokeh/metadata',
2020-06-12 16:41:28,532     <class 'bokeh.server.views.metadata_handler.MetadataHandler'>,
2020-06-12 16:41:28,532     {'application_context': <bokeh.server.contexts.ApplicationContext object at 0x7fa3eaaba240>,
2020-06-12 16:41:28,532      'bokeh_websocket_path': '/armax_bokeh/ws'}),
2020-06-12 16:41:28,532    ('/armax_bokeh/autoload.js',
2020-06-12 16:41:28,532     <class 'bokeh.server.views.autoload_js_handler.AutoloadJsHandler'>,
2020-06-12 16:41:28,532     {'application_context': <bokeh.server.contexts.ApplicationContext object at 0x7fa3eaaba240>,
2020-06-12 16:41:28,532      'bokeh_websocket_path': '/armax_bokeh/ws'}),
2020-06-12 16:41:28,533    ('/?',
2020-06-12 16:41:28,533     <class 'bokeh.server.views.root_handler.RootHandler'>,
2020-06-12 16:41:28,533     {'applications': {'/armax_bokeh': <bokeh.server.contexts.ApplicationContext object at 0x7fa3eaaba240>},
2020-06-12 16:41:28,533      'index': None,
2020-06-12 16:41:28,533      'prefix': '',
2020-06-12 16:41:28,533      'use_redirect': True}),
2020-06-12 16:41:28,533    ('/static/extensions/(.*)',
2020-06-12 16:41:28,533     <class 'bokeh.server.views.multi_root_static_handler.MultiRootStaticHandler'>,
2020-06-12 16:41:28,533     {'root': {}}),
2020-06-12 16:41:28,533    ('/static/(.*)',
2020-06-12 16:41:28,533     <class 'bokeh.server.views.static_handler.StaticHandler'>)]
2020-06-12 16:41:28,535 Bokeh app running at: http://localhost:5006/armax_bokeh
2020-06-12 16:41:28,535 Starting Bokeh server with process id: 32177
BokehDeprecationWarning: 'WidgetBox' is deprecated and will be removed in Bokeh 3.0, use 'bokeh.models.Column' instead
2020-06-12 16:41:43,547 [pid 32177] 0 clients connected
2020-06-12 16:41:43,548 [pid 32177]   /armax_bokeh has 1 sessions with 1 unused
2020-06-12 16:41:58,538 [pid 32177] 0 clients connected
2020-06-12 16:41:58,538 [pid 32177]   /armax_bokeh has 1 sessions with 1 unused
2020-06-12 16:42:02,539 Scheduling 1 sessions to discard
2020-06-12 16:42:02,539 Discarding session 'G0XnYsWEEHMkiCv6C0gHhRF93BSdquPNHONWNXbTIskI' last in use 30654.41116500087 milliseconds ago
2020-06-12 16:42:02,539 Deleting 1 modules for <bokeh.document.document.Document object at 0x7fa3eaaa9fd0>
2020-06-12 16:42:13,541 [pid 32177] 0 clients connected
2020-06-12 16:42:13,541 [pid 32177]   /armax_bokeh has 0 sessions with 0 unused

Console output:

If websockets are blocked then a Bokeh server app will not be an option for you.

I would very much like elevate the Bokeh protocol to be more independent of the existing specific Bokeh server implementation based on Tornado. And that could even include things like allowing the protocol to work over plain HTTP connections with long-polling instead of websockets. But I can’t speculate when that might happen.

Hi Bryan,

Thanks for the quick reply and the info about possible future developments. Sounds very interesting and I’ll look out for any development on that front. Thanks again and much appreciated!

Andrew