Connect local ws server to browser frontend #9252
-
Hi there! Anyone can help me to understand Theia a bit better? Let's say we have a browser app version of Theia and the user has a web socket server running locally. How would you connect the frontend of a Theia extension to this web socket server ? Maybe point me to an example application ? I tried using the json-rpc doc in https://theia-ide.org/docs/json_rpc but not sure how to test it is working. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
If your code runs in the browser you can simply use the browser's WebSocket APIs and whatever protocol your server uses. If it is running in node you can depend on the |
Beta Was this translation helpful? Give feedback.
-
Thanks @marechal-p I analyzed the backend template from theia generator to understand how it works. |
Beta Was this translation helpful? Give feedback.
If your code runs in the browser you can simply use the browser's WebSocket APIs and whatever protocol your server uses. If it is running in node you can depend on the
ws
package to do the same but using a different API.