Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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. #1002

Closed
hyfsgit opened this issue Oct 28, 2017 · 8 comments
Assignees
Labels
Feature It's a new feature. TransByAI Translated by AI/GPT.
Milestone

Comments

@hyfsgit
Copy link

hyfsgit commented Oct 28, 2017

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

@hyfsgit hyfsgit changed the title 跨域获取资源在服务器端怎么配置 使用http-flv协议,前台请求需要跨域获取flv流,我看过wiki,还没有找到答,求帮助,谢谢 Oct 30, 2017
@hyfsgit hyfsgit changed the title 使用http-flv协议,前台请求需要跨域获取flv流,我看过wiki,还没有找到答,求帮助,谢谢 使用http-flv协议,前台请求需要跨域获取flv流,我看过wiki,还没有找到答案,求帮助,谢谢 Oct 30, 2017
@alon21034
Copy link

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.

@hyfsgit
Copy link
Author

hyfsgit commented Oct 31, 2017

I resolved the problem with the same way yesterday, thanks for your help

@canglongxiang
Copy link

canglongxiang commented Oct 31, 2017

@hyfsgit Did you solve this problem by modifying the source code as mentioned above? I am currently facing the same issue.

TRANS_BY_GPT3

@hyfsgit
Copy link
Author

hyfsgit commented Oct 31, 2017

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

@hyfsgit
Copy link
Author

hyfsgit commented Nov 1, 2017

All the same, we are modifying the source code, but we are modifying different files.

TRANS_BY_GPT3

@hyfsgit
Copy link
Author

hyfsgit commented Nov 1, 2017

His method is a little safer, so you should still follow his method to make changes.

TRANS_BY_GPT3

@hyfsgit hyfsgit closed this as completed Nov 1, 2017
@hyfsgit hyfsgit reopened this Nov 1, 2017
@hyfsgit hyfsgit closed this as completed Nov 3, 2017
@winlinvip
Copy link
Member

winlinvip commented Jan 4, 2018

There are several solutions:

  1. Add an HTTP proxy: https://github.com/ossrs/go-oryx/tree/develop/httpx-static
  2. 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

@winlinvip
Copy link
Member

Dup to #717 #798 #1002 #1025

@winlinvip winlinvip self-assigned this Sep 12, 2021
@winlinvip winlinvip added the Feature It's a new feature. label Sep 12, 2021
@winlinvip winlinvip added this to the 3.0 milestone Sep 12, 2021
@winlinvip winlinvip changed the title 使用http-flv协议,前台请求需要跨域获取flv流,我看过wiki,还没有找到答案,求帮助,谢谢 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. Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature It's a new feature. TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

4 participants