简体   繁体   English

捕获来自客户端的HTTP请求(包括ajax)

[英]Catch HTTP requests (including ajax) from the client

I would like to write code that can catch: 我想编写可以捕获的代码:

  • (1) Clicking on links or changing the window.location programmaticly (1)单击链接或以编程方式更改window.location
  • (2) The user changes the url via the location bar (2)用户通过位置栏更改网址
  • (3) AJAX requests (3)AJAX请求

Is it even possible? 可能吗 How do I do that? 我怎么做?

  1. Yes, thats a simple step. 是的,那是一个简单的步骤。 Just give the button an action which access the server via AJAX. 只需给按钮做一个动作即可通过AJAX访问服务器。
  2. What do you mean exactly? 你到底是什么意思 Do you want to know where the user heading to when he do that over the location bar? 您是否想知道用户在位置栏上进行操作时要去的地方?
  3. Do you want to track every AJAX request or your goal is to send them via AJAX? 您是否要跟踪每个AJAX请求,或者您的目标是通过AJAX发送它们?

I don't get completely what you are trying to achieve and at what point you want to instrument the code. 我没有完全了解您要达到的目标以及在什么时候要检测代码。 But in case this helps, this something that can be achieved through HTTP Proxy . 但是,如果这有帮助,可以通过HTTP Proxy实现。 On a network you can redirect the traffic trough a Proxy server where in you can have your plugged in modules that can scan the outgoing requests and take some action(action could be reporting to some other server). 在网络上,您可以通过代理服务器重定向流量,在其中您可以插入模块,这些模块可以扫描传出的请求并采取某些措施(该措施可能会报告给其他服务器)。 Of course you won't need to instrument anything here. 当然,您无需在此处进行任何检测。 Most of the internet firewalls peg on this I guess. 我猜,大多数Internet防火墙都与此挂钩。

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

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