AgoraIO-Community / Agora-RTC-React

A react wrapper for Agora RTC NG SDK
MIT License
92 stars 48 forks source link

Blocked by CORS policy #8

Closed DeepakSaini119 closed 3 years ago

DeepakSaini119 commented 3 years ago

Hi, I followed the tutorial from here. Except, according to this SO question, token based authentication is mandatory now. I enabled that by generating a token and giving the value(instead of null), but I still get the error:

Access to XMLHttpRequest at 'https://cds-ap-web-3.agora.io/api/v1?action=config' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

Am I missing something. TIA.

EkaanshArora commented 3 years ago

Hey @DeepakSaini119 this isn't a problem with this repo. You're getting CORS because you're trying to access the token from your localhost over HTTP. I'd recommend trying the same code with HTTPS instead.