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

HTTP Stream supports CROS cross-domain #717

Closed
winlinvip opened this issue Dec 14, 2016 · 6 comments
Closed

HTTP Stream supports CROS cross-domain #717

winlinvip opened this issue Dec 14, 2016 · 6 comments
Assignees
Labels
Feature It's a new feature. TransByAI Translated by AI/GPT.
Milestone

Comments

@winlinvip
Copy link
Member

winlinvip commented Dec 14, 2016

Reference: #691, Add crossdomain support in http_remux and hls for HTML5 playback.

TRANS_BY_GPT3

@winlinvip winlinvip changed the title HTTP HTTP Stream支持CROS跨域 Dec 14, 2016
@winlinvip winlinvip added this to the srs 3.0 release milestone Dec 14, 2016
@winlinvip
Copy link
Member Author

winlinvip commented Dec 14, 2016

HTTP API automatically supports CROS (Cross-Origin Resource Sharing) for convenient access by JavaScript. If HTTP Stream needs to support MSE (Media Source Extensions), it also needs to support JavaScript access, which means supporting CROS cross-origin.

TRANS_BY_GPT3

@winlinvip
Copy link
Member Author

winlinvip commented Dec 15, 2016

Already supported, but I couldn't make it work in chrome54. I guess it's because I'm not using the correct way to initiate the xhr request. You can give it a try, it's added in 3.0.9.

TRANS_BY_GPT3

@winlinvip
Copy link
Member Author

winlinvip commented Dec 15, 2016

Before the refinement, the changes can be found here: https://github.com/ossrs/srs/pull/691/files

After the refinement, the changes can be found here: b231550

First refactor, improving existing API's CORS: f30b307

Second refactor, removing HLS RAM: 664844b

With less code, achieve more comprehensive functionality. The latter also supports reload, and the configuration file has been updated.

If we count the two refactors, the latter will definitely have more code than the former, but refactor is not directly related to adding new functionality; it improves the existing code.

Therefore, it is recommended to perform necessary refactoring before adding new functionality.

TRANS_BY_GPT3

@winlinvip
Copy link
Member Author

Dup to #717 #798 #1002 #1025

@winlinvip
Copy link
Member Author

winlinvip commented Dec 25, 2019

image

image

Note that if Nginx has set the cross-origin header, SRS3 will also set it once, which will cause this error. This means that there are two cross-origin headers, which can be disabled in SRS3 by turning off CORS.

http_server {
    crossdomain off;
}

Alternatively, you can remove this header setting from Nginx or use more_set_headers.

TRANS_BY_GPT3

@Eminem58
Copy link

Eminem58 commented Sep 8, 2021

What should I do with 'srs2'?

TRANS_BY_GPT3

@winlinvip winlinvip self-assigned this Sep 18, 2021
@winlinvip winlinvip added the Feature It's a new feature. label Sep 18, 2021
@winlinvip winlinvip changed the title HTTP Stream支持CROS跨域 HTTP Stream supports CROS cross-domain 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

2 participants