javascript - 新的网络托管破坏了与旧网络托管一起使用的网络摄像头
问题描述
我有一个爱好天气网站,我最近从 HostGator 网络托管转移到 Hostinger 网络托管。除了我的网络摄像头外,新主机上的一切都运行良好。网站上的 cam 页面使用脚本从我的相机中提取静态图像,显示它,然后每 1 秒更新一次……这在旧主机上运行良好,而在新主机上失败。在编码方面,我完全是个笨蛋,不知道如何解决这个问题。但是,我确实怀疑问题是对我的新主机上的所有内容强制使用 SSL 的方式。脚本从我的相机中提取的 URL 是:http: //172.100.163.136/webcapture.jpg ?command=snap&channel=1&user=viewer&password
该 URL 在浏览器中作为 http 但不是 https
这是我正在使用的脚本:
<script type="text/javascript">
// <![CDATA[
var refreshrate = 1; // seconds between refresh
var image = "http://172.100.163.136/webcapture.jpg?command=snap&channel=1&user=viewer&password"; // image name
var imgwidth = 665; // image width
var imgheight = 374; // image height
var imgalt = "WebCam Image";
var imgtitle = "header=[WebCam Image] body=[WebCam Image Automatically Updated Every 1-2 Seconds] delay=[500]";
function refresh() { document.images["pic"].src = image + "?" + new Date(); setTimeout('refresh()', refreshrate * 500); }
document.write('<img src="' + image + '" alt="' + imgalt + '" title="' + imgtitle + '" name="pic" id="pic" width="' + imgwidth + '" height="' + imgheight + '" style="border:1px dashed gray;"/>');
if(document.images)window.onload=refresh;
// ]]>
</script>
有谁知道如何解决这个问题?
解决方案
好的,我找到了解决方案......新主机正在使用让我们加密 SSL 解决方案“强制”https。我能够更改设置以结束强制 https,但仍保持 SSL 完好无损。网络摄像头再次工作!
推荐阅读
- linux - 如何在linux中隐藏工具路径变量
- google-classroom - 我可以在没有教育许可的情况下使用 GoogleClassroom API 的全部功能吗?
- excel - 如何根据标头计算实例?
- reactjs - 选择单选按钮并单击上传按钮时未调用 React 函数
- webrtc - 会话中视频聊天记录和回放技术/解决方案建议
- java - 在Android的滚动视图中覆盖旋转加载
- typescript - 在 tsc --build 如何克服 --incremental 和 --tsBuildInfoFile
- spring - jakarta.validation.Payload 类型无法解析
- reactjs - 我可以在 REACT 中加载嵌入式脚本,但无法在其中使用微调器。请提出任何替代方案或最佳解决方案
- c++ - push_back 的替代方法或如何加速二维数组的向量