But when I run the mentioned client, I have to change the endpoint address and add ‘openvidu/’ in the APPLICATION_SERVER_URL: POST http s://mydomain.com/openvidu/api/sessions
With this change, ‘createSession’ works perfectly, but when ‘createToken’ is executed, I get the following error in the console:
jquery-3.3.1.min.js:2 POST https://mydomain.com/openvidu/api/sessions/%5Bobject%20Object%5D/connections 400
The frontend app does not communicate with the server directly, you need an intermediary server called Application Server. Let me explain both parts to clarify it:
OpenVidu Server: This is the main component of OpenVidu, responsible for managing video call sessions and connections. However, it does not directly communicate with the front-end application that users interact with.
Application Server: This is a separate server from the OpenVidu Server. Its main purpose is to act as an intermediary between your front-end application and the OpenVidu Server. It handles requests from the front-end, authorizes them, and communicates these requests to the OpenVidu Server.
This two-step process (front-end → application server → OpenVidu Server) helps enhance the security of your video calls. It prevents the front-end application from communicating directly with the OpenVidu Server, protecting your sessions and connections.
To implement this, first you need to set up and deploy your application server. This server should be configured to communicate with the OpenVidu Server. It will handle tasks such as creating sessions and connections.
Once your application server is up and running, you then configure your front-end application to send its requests to the application server rather than the OpenVidu Server. This way, your front-end doesn’t talk directly to OpenVidu Server, but instead to your application server, which then communicates with OpenVidu Server.