简体   繁体   English

将外部网页加载到我的网站部分

[英]Load external web page to my website section

I am trying to load external pages display in my website.External pages are locally hosted on a server in same network. 我正在尝试加载网站中显示的外部页面。外部页面本地托管在同一网络中的服务器上。 So i called those pages in iframe like below 所以我在iframe中将这些页面称为如下

<iframe src="http://192.168.1.11/DSS/DashboardEngine.aspx?DashboardID=Muda\PSI\Rainfall" scrolling="auto" runat="server" width="99.8%" height="455px"></iframe> 

It is working if i access website from inside the network.But if access website from outside of network then that iframe section doesn't reach on local ip and giving error in iframe section. 如果我从网络内部访问网站就可以了,但是如果从网络外部访问网站,则该iframe部分将无法在本地ip上访问并在iframe部分中给出了错误。

Is there any way to run that iframe section on server side and then display it on client side? 有什么方法可以在服务器端运行该iframe部分,然后在客户端显示它吗?

If i access website locally then it display local pages in iframe without any error like below 如果我在本地访问网站,则它会在iframe中显示本地网页,而不会出现以下任何错误 在此处输入图片说明

If i access to website outside then that local pages in iframe giving error like un reachable to ip.here is error 如果我访问外部网站,则iframe中的本地页面会给出错误,例如无法访问ip.here是错误 在此处输入图片说明

With iFrame, it does not load the data ever to the host server. 使用iFrame,它永远不会将数据加载到主机服务器。 iFrame is ran on the clients device and loads inside of it. iFrame在客户端设备上运行并加载到其中。

To do something similar to showing a website's content inside your own, you would have to on call to a page, download the other pages content (html, hopefully all static with no dynamic or server calls) and inject it into your page. 要执行类似于在自己的网站上显示网站内容的操作,您必须调用页面,下载其他页面的内容(html,希望所有静态内容都没有动态或服务器调用),然后将其注入您的页面中。

That is to say, that just because you can see the internal server, does not mean the client can. 也就是说,仅仅因为您可以看到内部服务器,并不意味着客户端可以看到。 So you would have to proxy the content. 因此,您将不得不代理内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM