控件是否可以盲目代理另一个 URL,包括 PostBack?
是否可以有一个控件将请求代理到另一个域/网站,包括回发?
在此控件中,您可以指定要执行的 URL,并且每当执行该控件时,它都会向另一个 URL 发出 GET 请求,并呈现 HTML 返回。 (这部分并不难。)
但是,当页面回发时,它将向另一个页面发出 POST 请求,其所有回发变量都完好无损。
我真的正在寻找一个盲代理。某些控件将接受传入请求并向其抛出另一个 URL,然后呈现结果。另一个页面真的不知道它没有与人类交互。
我想我可以开发这个,但我不可能是第一个想做这件事的人,所以谷歌没有向我透露解决方案一定是有原因的。我怀疑我会遇到其他有这个想法的人遇到的同样的大问题。
It is possible to have a control that would proxy requests to another domain/Web site, including postback?
In this control, you would specify the URL you wanted to execute, and whenever the control executed, it would make a GET request to this other URL, and render the HTML return. (This part is not hard.)
However, when the page is posting back, it would make a POST request, with all of its postback variables intact, to this other page.
I'm really looking for a blind proxy. Some control that will take the incoming request and throw it another URL, and render the results. The other page would really have no idea it wasn't interacting with a human.
I want to think I could develop this, but I can't be the first person who wants to do it, so there has to be some reason why Google isn't revealing the solution to me. I suspect I'm going to run into the same Big Problem that anyone else with this idea has run into.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不太确定这个的价值是什么;这可能就是您尚未找到解决方案的原因。
然而,在我看来,有两种可能的解决方案。
I'm not exactly sure what the value of this is; which is probably why you haven't found a solution yet.
However, it seems to me that there are two possible solutions.
最终,这从来没有多少发挥作用的机会。我尝试了一段时间,但是回发需要对控件树有深入的了解,并且您不可能将回发从调用页面应用到另一个页面并使其正确覆盖,因为控件两个页面之间的树完全不同。
现在,如果您想将后端应用程序编写为更传统的 Web 应用程序(甚至不是 ASP.Net 中的应用程序),它可能会起作用。在回发期间,您可以迭代 Request.Form 值并将它们发回,然后让您的后端应用程序准备好接受这些传入值并处理它们,但这不是传统的回发。
In this end, this never had much of a chance of working. I experimented with it for a while, but Postback requires intimate knowledge of the control tree, and there's no way that you're going to be able to apply a postback from the calling page to the other page and have it overlay correctly because the control trees between the two pages are totally different.
Now, if you wanted to write the backend app as a more traditional Web app (even something not in ASP.Net), it might work. During postback, you could iterate the Request.Form values and send them back, and just have your backend app prepared to accept those incoming values and deal with them, but this wouldn't be a traditional postback.