Closed skoudoro closed 3 years ago
I don't see anything strange. What do you mean by "kill the session" then "start session".
It seems that the .connect
is only happening once, and therefore only on post request should happen to the launcher.
One thing though is that I would create the remoteView only after you have your connection available. But that might be fine the way it is.
Thank you for your feedback @jourdain.
After debugging step by step, it seems that the error is the following:
Access to XMLHttpRequest at 'http://127.0.0.1:8081/paraview' from origin 'http://127.0.0.1:5500' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
which makes sense since the client is on a different "domain" than the server. How can I fix this problem?
What do you mean by "kill the session" then "start session".
After failing with the error above, it automatically tries to reconnect by starting a new session which is strange to me. I need to create a gif.
Extend the apache config in docker with the proper CORS policy. I'm sure Google will provide good guidance on that for Apache.
The problem was coming from VScode LiveServer. I was using VScode LiveServer to start my external client http://127.0.0.1:5500.
However, the LiveServer refresh the session regularly so it was killing the current session and restarting and a new one every second.
using npx serve
resolved the problem. Also, I updated the CORS policy on the docker container as suggested by @jourdain.
Everything works like a charm now.
Thank you for your feedback/help @jourdain.
Hello Paraviewweb Team,
I run locally a docker version of paraviewweb. The instance is running on 127.0.0.1:8081 and I can access all my apps easily and everything works as expected.
However, I have trouble when I try to create an external client that will connect to my local docker server, call the launcher, start an app, and communicate with it via the WebSocket.
My external client run at 127.0.0.1:5500 and you can see below the html and js files. The external client is calling correctly the docker server and the app starts. However, it falls into a strange loop: start the app sessions, kills the app session, starts the app session, kill the app session etc....
Dozen of sessions are created and it never stops. What do I do wrong?
Thank you for the feedback.
HTML FILE
External CLIENT