meshcat-dev / meshcat

Remotely-controllable 3D viewer, built on top of three.js
MIT License
256 stars 48 forks source link

meshcat in react #106

Open emsoft1 opened 3 years ago

emsoft1 commented 3 years ago

hi @rdeits I need your help I want to use Meshcat inside a react component. before I change the HTML file in the Meshcat folder to add more abject but now I like to work with Mechcat inside the react component. is there any trick or tips you have for doing this? please tell me if you need more details. best regards mehrdad

emsoft1 commented 3 years ago

I find a way to run the visualizer on the react, and I have a viewer on the frontend. but the issue is I get a web socket error 1006 (onclose event ) . I get the same error if I run the HTML file in the dist folder alone or on another server app. I test the WebSocket on the postman, and it works, but I get the 1006 error in the browser even if I write a simple code to connect this WebSocket. This error happens as a restriction on the browser, and I think it is possible to solve it if we reduce the restriction in the server. I need help to solve the issue. How to set the server to allow any domain (local ) or host can connect to this server. In javascript, we have 'Access-Control-Allow-Origin.' Maybe there is a similar option here?

emsoft1 commented 3 years ago

@nim65s @jcarpent @wxmerkt any body can answer me here, please .?

I find a way to run the visualizer on the react, and I have a viewer on the frontend. but the issue is I get a web socket error 1006 (onclose event ) . I get the same error if I run the HTML file in the dist folder alone or on another server app. I test the WebSocket on the postman, and it works, but I get the 1006 error in the browser even if I write a simple code to connect this WebSocket. This error happens as a restriction on the browser, and I think it is possible to solve it if we reduce the restriction in the server. I need help to solve the issue. How to set the server to allow any domain (local ) or host can connect to this server. In javascript, we have 'Access-Control-Allow-Origin.' Maybe there is a similar option here?