如何在https中发出http请求

发布于 2025-01-12 17:58:31 字数 574 浏览 3 评论 0原文

我需要在我的网站中使用 https 请求运行 http 请求。

此代码在我的网站中使用 http: 例如 http://mywebsite.com 播放,但不要在 https 中播放:例如https://mywebsite.com

<audio id="stream" controls preload="none" autoplay style="width: 400px;">
    <source src="http://185.88.177.45:9948/;" type="audio/mpeg">
</audio>
<script>
    var audio = document.getElementById('stream');
    audio.volume = 0.5;
</script>

如何在 https 网站上玩?

I need run http request in my website with https request.

This code play in my website with http: for example http://mywebsite.com but dont play in https: for example https://mywebsite.com.

<audio id="stream" controls preload="none" autoplay style="width: 400px;">
    <source src="http://185.88.177.45:9948/;" type="audio/mpeg">
</audio>
<script>
    var audio = document.getElementById('stream');
    audio.volume = 0.5;
</script>

How to play in https webiste?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

计㈡愣 2025-01-19 17:58:31

不幸的是,浏览器策略规定,如果您对页面使用 HTTPS,则必须对音频流使用 HTTPS。

SHOUTcast 的较旧版本和免费版本不支持 HTTPS。 Icecast 可以,并且可以直接替代您。

Unfortunately, browser policy dictates that you must use HTTPS for your audio stream if you're using HTTPS for the page.

Older and free builds of SHOUTcast do not support HTTPS. Icecast does, and can be a drop-in replacement for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文