Is there a way to configure Fiddler to intercept HTTP calls from a Windows service?

前端 未结 5 1320
梦如初夏
梦如初夏 2021-02-01 06:44

We\'re in the process of replacing an old (5+ years) Windows service application built with VS2005 that makes an HTTP GET call. There are several things that make this difficul

5条回答
  •  悲&欢浪女
    2021-02-01 07:08

    Fiddler just acts as an HTTP proxy, so if you can configure a proxy in your service then you can configure it to go through Fiddler. Whether that's possible is hard to say...

    If that doesn't work, you could do it by running Fiddler on a second computer and configuring it to listen on port 80. Then on your "test" computer, edit your hosts file so that it points to the second computer instead. So say the web service is on www.example.com, you set up your test server so that "www.example.com" points to your second computer (running Fiddler). Then, when the service goes to connect to "www.example.com" it'll actually connect to Fiddler. Fiddler will then forward the connection to the real www.example.com after recording the request/response.

    I haven't tested the above, but I think it would work. Obviously, if you can configure the proxy settings in your service that would be easier!

提交回复
热议问题