Hi,

We have a python app and a JS front-end which currently talk using 
WebSockets:
- Python serves a port using flask and flask websockets.  
- The Browser loads some static JS from Flask, and the JS uses the same 
port to send & receive websockets. 
-- ie the connection is inbound from JS -> Python but once established the 
messages go both ways, mostly Python -> JS.

We would like to incorporate the JS front-end into a notebook.  We can 
currently only do this by getting the python to listen on a separate port 
from the Notebook Server.  This is manageable  on hosts which we completely 
control (eg a Google Cloud compute instance), but we would like to make it 
available on services like
- *MyBinder* (where we get reasonable control of a VM / container, but not 
inbound ports) 
- and maybe *CoLab* (where we don't control the VM).

So is there a way of "bridging" our own message channel from the Browser JS 
Client all the way through to the Kernel?

Kernel <---- ZMQ ----> Notebook Server <--- WebSockets---> Browser 
JavaScript App

We want to keep the notebook setting, ie I don't think we want to ditch the 
notebook in favour of Jupyter Kernel Gateway (if I'm reading it correctly).

For example is it possible to somehow set up a custom channel in the 
ZMQ/WebSockets bridge?

We could of course replace our existing WebSockets code at the Python end 
with something equivalent.

Should we perhaps wrap the JS into a IPyWidget?  This looks more 
complicated than we really need.  

Here's a couple of related questions, but they are somewhat old:
https://groups.google.com/forum/#!searchin/jupyter/websockets%7Csort:date/jupyter/JPlrh2XHxB8/oIGmkQHyBAAJ
https://stackoverflow.com/questions/16817901/accessing-ipython-command-line-from-node-js-and-websockets

Our project is open source - https://gitlab.aicrowd.com/flatland  :)

Thanks!

Jeremy.

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/16038bf5-cdee-4f33-95d9-a62cc40b2f50%40googlegroups.com.

Reply via email to