Using the http-flv protocol, the front-end request requires cross-origin access to obtain the flv stream. I have looked through the wiki but have not found an answer yet. Please help, thank you.
I only saw that http-api can support cross-origin in the wiki. I would like to ask if http-flv can also support cross-origin.
TRANS_BY_GPT3
I face the same problem, too. My workaround is adding
w->header()->set("Access-Control-Allow-Origin", "*");
in https://github.com/ossrs/srs/blob/master/trunk/src/app/srs_app_http_stream.cpp#L485 . Hope it will have an option in the conf file in the future.
I resolved the problem with the same way yesterday, thanks for your help
@hyfsgit Did you solve this problem by modifying the source code as mentioned above? I am currently facing the same issue.
TRANS_BY_GPT3
It is the same method as the one used by the person upstairs. Modify the http-conn file and add an additional attribute in the response header.
TRANS_BY_GPT3
All the same, we are modifying the source code, but we are modifying different files.
TRANS_BY_GPT3
His method is a little safer, so you should still follow his method to make changes.
TRANS_BY_GPT3
There are several solutions:
- Add an HTTP proxy: https://github.com/ossrs/go-oryx/tree/develop/httpx-static
- SRS3 supports CORS, but it is a bit complicated to merge it, so you can directly modify the code to support it, as shown above.
TRANS_BY_GPT3
Dup to #717 #798 #1002 #1025