Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to enable CORS for external web applications in OpenVidu Call backend? #2

Open
AoEiuV020 opened this issue Oct 16, 2024 · 1 comment

Comments

@AoEiuV020
Copy link

I am using the OpenVidu local deployment with the provided OpenVidu Call application. I would like to interact with the backend of the OpenVidu Call project from an external web application (e.g., creating or joining rooms through API calls). However, I'm encountering CORS (Cross-Origin Resource Sharing) errors when attempting to make requests from my web application.

Could you provide guidance or instructions on how to configure the OpenVidu Call backend to allow CORS so that external web applications can interact with the API?

Steps to Reproduce:

Deploy OpenVidu locally using openvidu-local-deployment.
Attempt to send a POST request from an external web app to the API endpoint (e.g., /api/rooms) using fetch or axios.
Observe CORS error in the browser console.
Expected behavior: The backend should respond to the API request without triggering CORS errors, or there should be a clear configuration option to enable CORS for the OpenVidu Call backend.

Current behavior: CORS errors prevent the external web application from successfully making requests to the backend.

Request: Could you provide guidance on how to configure the OpenVidu Call backend (or its server) to allow external web applications to make API calls (e.g., through headers such as Access-Control-Allow-Origin)?

Thank you for your help!

@cruizba
Copy link
Member

cruizba commented Oct 16, 2024

We will create an env variable to control this. Thanks for feedback!

At the moment, if you use TESTING_MODE as an env variable of the Call Backend, the CORS is configured to *

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants