Skip to content

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

@AoEiuV020

Description

@AoEiuV020

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!

Activity

cruizba

cruizba commented on Oct 16, 2024

@cruizba
Member

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @cruizba@AoEiuV020

        Issue actions

          How to enable CORS for external web applications in OpenVidu Call backend? · Issue #2 · OpenVidu/openvidu-local-deployment