在调试外部请求的时候,需要从服务器端抓包,分析请求与响应数据。 Filder不仅可以通过正向代理抓包,也可以通过反向代理抓包。
在fiddler中菜单Rules-Customize Rules中打开CustomRules.js文件中的OnBeforeRequest中设置请求主机为服务器的地址与端口。
static function OnBeforeRequest(oSession: Session)
{
if (oSession.host.toLowerCase() == "192.168.5.172:8080") oSession.host = "192.168.5.172:8081";
static function OnBeforeResponse(oSession: Session)
{
oSession.oResponse.headers["Location"]=oSession.oResponse.headers["Location"].Replace(":8081", ":8080");