Python VTK server + Remote View with VTK.js + multiple users

Hi,

I currently have a setup where I have a python web server using a vtk wheel and wslink to create a server and I have an javascript client connecting to it and I can load my models on the server and see them successfully on the client.

However, I want to create a multi-user setup where each user logs in to his account and creates a new session.

I am wondering if I should create my own custom code to achieve this or if you guys have this functionality built in.

I have seen this page:

Is this the approach I should be exploring? Or is there another way of achieving the same result?
Is there any more documentation or examples on this topic?

Thank you.

wslink provide the python launcher module which allow you to start a new process per user session. At that point you only need to configure it and the same is true with Apache.

So in short, you have all the pieces, but you need to configure them so they can work together and that documentation explain the role of each and what you should do to configure them.

Thank you Sebastien, I managed to get a working version. However I have a couple of questions:

Is there an example using nginx?

Also I think there’s a problem with wslink version 1.1.0 in the client, if I use version 0.1.15 in the client it works but if I use 1.1.0 on the client this error pops:

Error event: ConnectionReady TypeError: t.protocol.subscribeToImageStream(...).then is not a function
    at Object.e.connect (index.js:54)
    at Object.<anonymous> (index.js:134)
    at index.js:105
    at Array.forEach (<anonymous>)
    at l (index.js:102)

One more thing, if I close the browser tab, the process keeps going on the server, is this a mistake on my end or what can I do to close the session (plus the python process running on the server) once a user closes his tab?

Thank you very much.

I don’t have an example with nginx on hand.

There is indeed a breaking change in wslink 1.1 vs 0.1 but using vtk 9.1 with latest vtk.js should be just fine.

When you close your tab the process should go away after a timeout. I think the default is 300 seconds. But you can make it shorter if you provide the argument --timeout 10 for example.