首页 > 解决方案 > 新的网络托管破坏了与旧网络托管一起使用的网络摄像头

问题描述

我有一个爱好天气网站,我最近从 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>

有谁知道如何解决这个问题?

标签: javascriptsslwebcam

解决方案


好的,我找到了解决方案......新主机正在使用让我们加密 SSL 解决方案“强制”https。我能够更改设置以结束强制 https,但仍保持 SSL 完好无损。网络摄像头再次工作!


推荐阅读