I need to use fiddler to capture Android APP data packets and Debug PHP programs.
You need to debug the PHP program when the Android APP initiates a request to the server.
To split the target, follow these steps:
Debugging PHP using ECLIPSE + XDEBUG, while XDEBUG requires the get method to pass a parameter or set a COOKIE to trigger the breakpoint. I use the COOKIE method (I think this method is better)
That is to say, we need to find a way to enable the APP to carry COOKIE information when initiating a request. because I am not familiar with APP development, we can only find another way. my approach is to HOOK the request and then add the COOKIE value.
In addition to the ability to capture HTTP packets, fiddler can also modify requests and responses. what I need to modify is the request.
You can use fiddler to modify a request in either of the following ways: breakpoint, request header modification, or script writing. I used the second method.
Add the OnBeforeRequest method in the script file of fiddler
If (oSession. HostnameIs ("192.168.1.7 ")){
OSession. oRequest. headers. Add ("Cookie", "XDEBUG_SESSION = ECLIPSE_DBGP ");
}
This code indicates that
If the target address of the request is 192.168.1.7, add a COOKIE with the key XDEBUG_SESSION and the value ECLIPSE_DBGP. this is the COOKIE information required when I use eclipse to trigger PHP power-off, so far, my requirements have been met.
PS: If you use Firefox debugging and ECLIPSE to Debug php, you can use a plug-in called the easiest xdebug.
References: http://www.cnblogs.com/tankxiao/archive/2012/04/25/2349049.html#ScriptEditCookie
Http://xdebug.org/docs/remote
Http://docs.telerik.com/fiddler/KnowledgeBase/FiddlerScript/ModifyRequestOrResponse