开发者

How to edit HTTP request with Fiddler

开发者 https://www.devze.com 2023-01-10 03:26 出处:网络
Is it possible to edit HTTP request using fiddler so that my asp.net application hosted elsewhere return true for the following code block

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

精彩评论

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

关注公众号