Closed phcerdan closed 3 years ago
I'm not sure to follow, but sessionURL
is what the client use to connect to a running pvw process. So nothing to do with pvw-visualizer.py
.
If you want to start pvw-visualizer.py
on demand from the client, then you need to use the launcher.
I understand, thanks @jourdain. I thought it would be possible to avoid using a launcher, as in https://github.com/Kitware/web-project-templates/tree/master/vue-vtkjs-pvw-template, when using port 8080 for the client, and port 1234 for the pvw-server (the defaults).
$ npm run serve &
$ /.../pvpython ./server/pvpython/pvw-server.py --port 1234
Open your browser to http://localhost:8080/
Well, you can really hack adding config.sessionURL = 'ws://localhost:1234/ws';
to connect
here.
export function connect(config = {}) {
loading();
config.sessionURL = 'ws://localhost:1234/ws'; // <------- HACK TODO for development
network.onReady(start);
network.onError(loading);
network.onClose(() => loading('Server disconnected'));
network.connect(config);
// Configure renderer to local if asked for
if (config.renderer) {
dispatch(actions.view.setRemoteRendering(config.renderer === 'remote'));
}
}
Hi there @jourdain, instead of providing
--content ./dist
, I would like thepvw-visualizer.py
to listen to client from another port for development purposes (hot reload). I think the option is namedsessionURL
(inferred from the Vue example here),How can I hack passing
sessionURL
to the server throughpvw-visualizer.py
?