Is it possible to embed Bokeh within a Gunicorn based Flask app but where gunicorn is bound to a unix socket as opposed to an IP and port?
i.e. Gunicorn:
/usr/bin/python3 /usr/local/bin/gunicorn --workers 2 --bind unix:mysocket.sock -m 007 myproject:create_app()
And then replicating the flask_gunicorn_embed.py example on github doesn’t work as presumably the line:
sockets, port = bind_sockets(“localhost”, 0)
…sees the server later bound (using bokeh_http.add_sockets(sockets)) to the sockets on localhost (or whatever IP is specified in that field) as opposed to the unix socket?
I see there was once an issue raised for this feature but it was closed: Make bokeh server posible to listen unix socket. · Issue #5383 · bokeh/bokeh · GitHub
If I just try to specify the server IP, localhost or 127.0.0.1 in the bind_sockets call, I see net::ERR_CONNECTION_TIMED_OUT for: https://127.0.0.1:41779/bkapp/autoload.js?bokeh-autoload-element=1001&bokeh-app-path=/bkapp&bokeh-absolute-url=https://127.0.0.1:41779/bkapp presumably because gunicorn has bound to the socket and not the IP.
Can anyone advise whether they’ve been able to embed bokeh in a Flask app where Gunicorn is bound to a socket and note the adjustments they’ve had to make to the flask_gunicorn_embed.py example? I’ve tried specifying mysocket.sock in the bind_sockets call instead but this crashes the app…
Thanks,
Carl