HTML href 链接到本地​​网络摄像机网络服务器

发布于 2024-12-01 04:14:43 字数 460 浏览 0 评论 0原文

我有一个在 NAS 服务器上运行的网站,并且我的网络上还有一个 ip 摄像机。我可以在路由器上配置端口转发,将 http 请求从互联网转发到我的 nas 网站 (192.168.1.64) 或 ip 摄像机 (192.168.1.200)。我已经独立配置了两者并且能够从互联网访问。但是,我只有一个 IP 地址,因此我在路由器上配置了端口转发,以将 http 请求(端口 80)转发到 NAS 上的网站,在该网站上我在默认 html 页面上提供了到 IP 摄像机的超链接 (href= http://192.168.1.200/....html)。在家里,该链接可以正常工作,因为互联网浏览器正在我网络上的计算机上运行。但是从我的路由器(互联网)之外的计算机浏览该链接不起作用。浏览器正在尝试与 Internet 上不存在的 IP 地址 192.168.1.200 进行通信。如何从路由器后面的 NAS 网站上的 html 页面链接到 ip 摄像机网站。我希望我已经足够详细地解释了这一点,以便您能够理解。

I have a website running on a NAS server and I also have a ip camera on my network. I can configure port forwarding on my router to forward http requests to either my nas website (192.168.1.64) or ip camera (192.168.1.200) from the internet. I have configured both independently and was able to access from internet. However, I only have one IP address so I have configured port forwarding on my router to forward http requests ( port 80) to the web site on my NAS where I have provided a hyperlink on the default html page to the IP camera (href=http://192.168.1.200/....html). From home the link works because the internet browser is running on a computer on my network. But browsing from a computer ouside of my router ( the internet) the link does not work. The browser is attempting to communicate with ip address 192.168.1.200 which do not exist on the internet. How can I link to the ip camera website from a html page on my NAS website behind the router. I hope I have explained this in enough detail for you to understand.

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

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

发布评论

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

评论(1

镜花水月 2024-12-08 04:14:43

你不能,简单明了。这是因为您永远无法让浏览器直接连接没有端口转发的设备,因此您永远无法将页面直接从该设备加载到浏览器,无论您如何尝试使用它。

当我在这个答案中提到“其他设备”时,我指的是没有通过路由器打开端口的设备。

抛开您这样做所造成的安全问题(坦率地说,让我感到害怕),您有两个选择:

  1. 在路由器上设置到其他设备的端口重定向,以便将不同的公共端口在内部重定向到端口 80。这意味着您可以直接通过互联网访问这两个设备。并非所有路由器都支持此(尽管相当基本)功能。
  2. 设置某种形式的代理脚本,该脚本将从其他设备获取页面并将其显示在具有端口转发的设备上的页面上(可能在 iframe 中?)。这可能需要网络内的第三个 Web 服务器,因为 NAS 或相机不太可能支持任何形式的脚本语言。

我不推荐这两种选择,但这就是你剩下的选择。

这样做会在网络安全中造成巨大漏洞。只有当您 100% 相信这两种设备在任何情况下都不会被黑客入侵这一事实时,才可以这样做。您对某些不是您编写的软件甚至某些您编写的软件有信心吗?

You can't, plain and simple. This is because you can never get your browser to connect the device that does not have the port forward directly, therefore you can never load a page directly from that device to your browser, however you try and work it.

When I refer to "the other device" in this is answer, I am referring to whichever one does NOT have the port opened through the router to it.

Setting aside the security problems you are creating by doing this that frankly, horrify me, you have two options:

  1. Set up a port redirect on your router to the other device, so that a different public port is redirected to port 80 internally. This would mean you could access both devices directly across the internet. Not all routers support this (albeit fairly basic) functionality.
  2. Set up some form of proxy script that will fetch the page from the other device and display it on a page (in an iframe maybe?) on the device that does have a port forward. This will probably require a third web server inside your network, since it is unlikely either the NAS or the camera will support any form of scripting language.

I do not recommend either of these options, but that is what you are left with.

You are creating a huge hole in your network security by doing this. Only do it if you 100% trust the fact the neither device could under any circumstances be hacked into. Are you that confident in some software you didn't write - or even some you did?

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