How to intercept Http traffic

I am trying to develop a C # application that will intercept an outgoing Http request and return the result to the old system. We have an outdated system that makes an Http request for a discontinued web service. I need to intercept an incoming request and send it to a new web service. When the answer comes back, I need to manipulate it and then send it to the legacy system. All code must be on the client machine. I thought something like an http listener would work, but I won’t go anywhere, any suggestions would be greatly appreciated.

+4
source share
6 answers

Thank you all for your suggestions, here is the answer.

I used Fiddler2 from Eric Lawrence to act as a proxy for me. Then I wrote the Fiddler extension, which intercepted a specific Http request that interested me, and voila.

+4
source

If this runs on a Windows server, you can edit the hosts file to redirect the request to some other server, including the same host (localhost), if you want. There you can have an intermediate web service translating the request and response.

+2
source

Does the legacy system support the HTTP proxy specification? If yes, then perhaps what you want to do is write something that acts as a proxy and point to the old system.

+1
source

If your legacy system can use a proxy server, as Dove suggests, you can use something like Foxy to do the redirection. I'm not sure, but I believe that some software uses IE to transport HTTP, so try installing the HTTP proxy in IE on the client machine?

If this is not the case, I think this is a difficult problem, since in essence you are trying to intercept and modify TCP / IP traffic, which, in my opinion, is possible only with the help of an advanced firewall or router.

+1
source

tcpmon is an open source utility for monitoring data transmitted over a TCP connection. tcpmon is used by placing it between the client and server. The client connects to tcpmon, and tcpmon sends the data to the server along with its display in the graphical interface. https://tcpmon.dev.java.net/

0
source
-2
source

All Articles