HTML href 链接到本地网络摄像机网络服务器
我有一个在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不能,简单明了。这是因为您永远无法让浏览器直接连接没有端口转发的设备,因此您永远无法将页面直接从该设备加载到浏览器,无论您如何尝试使用它。
当我在这个答案中提到“其他设备”时,我指的是没有通过路由器打开端口的设备。
抛开您这样做所造成的安全问题(坦率地说,让我感到害怕),您有两个选择:
我不推荐这两种选择,但这就是你剩下的选择。
这样做会在网络安全中造成巨大漏洞。只有当您 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:
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?