【发布时间】:2014-07-26 12:48:04
【问题描述】:
我正在尝试使用使用 XHR 的 Dancer.js 从我的 icecast2 服务器流式传输音乐。
但是,目前我遇到了错误(将实际域替换为 example.com):
XMLHttpRequest cannot load http://example.com:8000/stream.ogg. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://example.com' is therefore not allowed access.
我一直在寻找有关如何向流中添加自定义标头的信息,但找不到任何相关信息。
如何将 access-control-allow-origin 标头添加到此流中?
我看到一些 anwsers 告诉我将其添加到 apache 配置或 .htaccess 中,但由于这没有使用无法工作的 apache 服务。
谢谢。
【问题讨论】:
-
我认为有一种方法可以在 Icecast 中添加标题,但我不记得了。如果你没有得到这个工作,CORS 标头在我自己的服务器 AudioPump 中是标准的。如果您想尝试一下,请发送电子邮件至 brad@audiopump.co
标签: http-headers xmlhttprequest debian icecast