srs icon indicating copy to clipboard operation
srs copied to clipboard

WHEP: The 'Access-Control-Allow-Origin' header is missing for CORS

Open aiquanpeng opened this issue 1 year ago • 2 comments

The error message reads as follows: Access to XMLHttpRequest at 'http://10.244.3.204:1985/rtc/v1/whep/?app=live&stream=livestream' from origin 'http://direct.virtaicloud.com:20410/' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

TRANS_BY_GPT4

aiquanpeng avatar May 24 '24 02:05 aiquanpeng

Please provide a detailed description of the steps to reproduce the issue, otherwise, this issue will be removed.

TRANS_BY_GPT4

winlinvip avatar May 24 '24 02:05 winlinvip

https://github.com/ossrs/srs/blob/282d94d7bbfa127868caab401bb7616e26d4c54d/trunk/src/protocol/srs_protocol_http_stack.cpp#L887-L912

SRS already supported CORS request, it is maybe your service deployment problem.

suzp1984 avatar May 28 '24 03:05 suzp1984