屏蔽外部 URL
我需要能够在我的网站中打开外部 URL,而不会将其透露给我的用户(在浏览器中和源代码中)。 我不希望他们能够复制 URL 并根据自己的喜好编辑查询字符串。 有没有办法在 iframe 或类似内容中打开 URL,并隐藏/屏蔽其来源?
这是一个asp.net 2.0网站。
I need to be able to open up an external URL in my website with out revealing it to my users (both in the browser and in the source). I do not want them to be able to copy the URL and edit the query string to their liking. Is there a way to open the URL in an iframe, or something of the like, and hide/mask its source?
This is an asp.net 2.0 website.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您可以执行以下操作:
这样用户就永远不会知道其他网站,而且应该更安全。
这还可以使用一些验证/身份验证,以便用户无法更改传递的参数来检索其他用户的 PDF。
Could you do the following:
This way users would never know about the other site, and it should be much more secure.
This could also use some validation/authentication so users are unable to alter the parameters passed to retrieve other users' PDFs.
不可以。如果您让客户端计算机执行某些操作(即将其浏览器指向网页),则您无法向他们保留该信息。
您可以在 Flash 小部件或其他容器中渲染该页面服务器端,但不能在客户端计算机上执行此操作。
No. If you are having the clients machine do something (i.e, point their browser to a web page), you can not keep that information from them.
You can render that page server side in a flash widget or some other container but you can't do it on the clients machine.
最佳选择:您可以发出服务器端 XMLHTTP 请求,获取响应并使用 AJAX 将其反馈到您的页面中。
Best bet: You can make a server-side XMLHTTP request, grab the response and feed in back into your page using AJAX.
您可以通过以下方式在服务器端执行此操作:
您想要的站点
URL
但这可能会大大减慢页面加载速度,并且可能会带来法律问题。
You could possibly do it server side by:
site you want
URL
That would probably slow down your page load considerably though, and could come coupled with legal issues.
不久前我自己也遇到了类似的问题,并按照这些思路做了一些事情(C# .NET 2.0);
显然,您必须定制 HTML 的编写方式以适应您的特定应用程序,并且您将破坏目标站点中的所有相关链接(图像 URL、CSS 链接等),但如果您只需要简单的文本HTML 并希望您的网络应用程序在服务器端获取它,那么这是一个好方法。
I had a similar problem myself a while ago and did something along these lines (C# .NET 2.0);
You would have to tailor the writing of the HTML to suit your particular application obviously, and you'd break all of the relative links in the target site (image URLs, CSS links etc.), but if you're only after simple text HTML and want your web app to grab it server-side, then this is a good way to go.
您可以通过执行以下操作来创建一次性 URL:
You can make a one-time URL by doing the following: