Repository: bokeh/bokeh

Issue:
Make websocket_max_message_size configurable in notebooks
When bokeh server is embedded in a notebook (like here https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/notebook_embed.ipynb) there are connection errors when plots are large, like in #7374 (and smaller plots work just fine).  I see from the docs I can use `--websocket-max-message-size` argument or `websocket_max_message_size` kwarg with a large enough value for a standalone bokeh server.

However, it is not currently possible to pass that argument to the `Server` class from notebook when using `bokeh.io.show(app, notebook_url)`:
https://github.com/bokeh/bokeh/blob/d260c429451a04b1fc00f593ef98f10ce1392e57/bokeh/io/notebook.py#L475

The solution would be to pass something like `server_kwargs` to `show()` so that they go through to the `Server.__init__`.

An example notebook to test the functionality can be constructed from the following code:
```python
import numpy as np

from bokeh.plotting import figure
from bokeh.io import show, output_notebook
from bokeh.palettes import Inferno

output_notebook()

def modify_doc(doc):
    size = 3000
    a = np.broadcast_to((np.arange(size, dtype=np.float64))[np.newaxis, :], (size, size))

    plot = figure(x_range=(0, 100), y_range=(0, 100))
    plot.image(
        image=[a], x=[0], y=[0], dw=[100], dh=[100],
        palette=Inferno[256]
    )
    
    doc.add_root(plot)

show(modify_doc)
```


Discussion:

Resolving patch:
diff --git a/bokeh/io/notebook.py b/bokeh/io/notebook.py
--- a/bokeh/io/notebook.py
+++ b/bokeh/io/notebook.py
@@ -166,9 +166,10 @@ def install_notebook_hook(notebook_type, load, show_doc, show_app, overwrite=Fal
             .. code-block:: python
 
                 show_app(
-                    app,         # the Bokeh Application to display
-                    state,       # current bokeh.io "state"
-                    notebook_url # URL to the current active notebook page
+                    app,          # the Bokeh Application to display
+                    state,        # current bokeh.io "state"
+                    notebook_url, # URL to the current active notebook page
+                    **kw          # any backend-specific keywords passed as-is
                 )
 
         overwrite (bool, optional) :
@@ -429,7 +430,7 @@ def publish_display_data(*args, **kw):
     from IPython.display import publish_display_data
     return publish_display_data(*args, **kw)
 
-def show_app(app, state, notebook_url, port=0):
+def show_app(app, state, notebook_url, port=0, **kw):
     ''' Embed a Bokeh serer application in a Jupyter Notebook output cell.
 
     Args:
@@ -456,6 +457,8 @@ def show_app(app, state, notebook_url, port=0):
             By default the port is 0, which results in the server listening
             on a random dynamic port.
 
+    Any additional keyword arguments are passed to :class:`~bokeh.server.Server` (added in version 1.1)
+
     Returns:
         None
 
@@ -472,7 +475,7 @@ def show_app(app, state, notebook_url, port=0):
     else:
         origin = _origin_url(notebook_url)
 
-    server = Server({"/": app}, io_loop=loop, port=port,  allow_websocket_origin=[origin])
+    server = Server({"/": app}, io_loop=loop, port=port,  allow_websocket_origin=[origin], **kw)
 
     server_id = uuid4().hex
     curstate().uuid_to_server[server_id] = server
diff --git a/bokeh/io/showing.py b/bokeh/io/showing.py
--- a/bokeh/io/showing.py
+++ b/bokeh/io/showing.py
@@ -43,7 +43,7 @@
 # General API
 #-----------------------------------------------------------------------------
 
-def show(obj, browser=None, new="tab", notebook_handle=False, notebook_url="localhost:8888"):
+def show(obj, browser=None, new="tab", notebook_handle=False, notebook_url="localhost:8888", **kw):
     ''' Immediately display a Bokeh object or application.
 
         :func:`show` may be called multiple times in a single Jupyter notebook
@@ -117,6 +117,9 @@ def show(obj, browser=None, new="tab", notebook_handle=False, notebook_url="loca
     * The ``notebook_url`` parameter only applies when showing Bokeh
       Applications in a Jupyter notebook.
 
+    * Any additional keyword arguments are passed to :class:`~bokeh.server.Server` when
+      showing a Bokeh app (added in version 1.1)
+
     Returns:
         When in a Jupyter notebook (with ``output_notebook`` enabled)
         and ``notebook_handle=True``, returns a handle that can be used by
@@ -137,7 +140,7 @@ def show(obj, browser=None, new="tab", notebook_handle=False, notebook_url="loca
     # This ugliness is to prevent importing bokeh.application (which would bring
     # in Tornado) just in order to show a non-server object
     if is_application or callable(obj):
-        return run_notebook_hook(state.notebook_type, 'app', obj, state, notebook_url)
+        return run_notebook_hook(state.notebook_type, 'app', obj, state, notebook_url, **kw)
 
     return _show_with_state(obj, state, browser, new, notebook_handle=notebook_handle)
 


Test patch: