Currently, I downloaded the OpenBitu on-premise guide to ec2 and proceeded with ./openvidu start.
The request for “https://url:8443/openvidu/api/sessions” on the client end (currently localhost:3000) is then blocked by CORS.
In another article, I understand that the implementation of the openvidu server already has a way to handle the corresponding CORS, so could you tell me why this problem occurs?
I’m currently testing based on the work I’ve done through openvidutual. (with React.js)
async createSession(sessionId) {
const response = await axios.post(
APPLICATION_SERVER_URL + "api/sessions",
{ customSessionId: sessionId },
{
headers: {
Accept: "application/json",
Authorization:
"Basic " + Buffer.from("OPENVIDUAPP:ov109").toString("base64"),
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,PUT,POST,DELETE,PATCH,OPTIONS",
},
}
);
return response.data; // The sessionId
}
async createToken(sessionId) {
const response = await axios.post(
APPLICATION_SERVER_URL + "api/sessions/" + sessionId + "/connections",
{ customSessionId: sessionId },
{
headers: {
Accept: "application/json",
Authorization:
"Basic " + Buffer.from("OPENVIDUAPP:ov109").toString("base64"),
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,PUT,POST,DELETE,PATCH,OPTIONS",
},
}
);
return response.data; // The token
}