开发者

showing internet content on an intranet site

开发者 https://www.devze.com 2023-02-13 09:02 出处:网络
I\'ve an ASP.NET application hosted inside a local area network. The application host machi开发者_高级运维ne has access to the internet while the local area network clients do not.

I've an ASP.NET application hosted inside a local area network. The application host machi开发者_高级运维ne has access to the internet while the local area network clients do not.

There is one requirement where I've to show a web page with rich content (images) in an IFrame from internet (public network) address.

However since internet access is not available on the client, this somehow has to be done from server and then needs to be served to client.

How can this be done?


You can use HttpWebRequest and HttpWebResponse from your application's code to query another server, then you can re-serve it's response by ouputting it to Response. To replicate an actual web page, you'd further have to parse out all embedded resources (scripts, images, whatever) and request them from the host server again, and create an architecture so they could be re-streamed from your application. That is, if you simply regurgitated the response for a page request, none of the resources would load since the client wouldn't have access. You'll need to re-write those URLs in the page to something on your server that will then re-request them from the real server. Sounds like a pain to me, but technically doable.

I would think it a lot easier to create some kind of proxy that will allow your clients to access the the site directly through your portal. (What I'm proposing above is basically a specialized proxy). If you can work directly with IIS, you could create something that functioned as a more direct proxy for this purpose. I'm guessing there must be a good reason why you need to do this, like, these are public terminals at a retail store and you obviously don't want your customers price-shopping from there :)

0

精彩评论

暂无评论...
验证码 换一张
取 消