开发者

How to edit HTTP request with Fiddler

Is it possible to edit HTTP request using fiddler so that my asp.net application hosted elsewhere return true for the following code block

HttpContext.Current.Request.Url.Host 开发者_Python百科== "localhost"


Sure you can. Simply add the following:

if (oSession.hostname == "fakelocal"){
oSession.hostname = "localhost";
oSession["x-overrideHost"] = "123.1.1.1"; // <-- Server IP here!
}

Then, use the url: http://fakelocal/whatever in the client.

Fiddler will change the host header to "LOCALHOST" and direct the request to the server IP of your choice.

Note, of course, that this won't work if there's a proxy upstream, because upstream proxies do their own DNS lookups.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜