Once upon a time, there was a tool named TCPMon to inspect HTTP traffic, which was very handy for debugging web services(SOAP and other… Passthru: Monitoring HTTP traffic via a very simple proxy ... while implementing a Simple Proxy server using Spring Boot+Zuul +Kotlin. You can ...
Once upon a time, there was a tool named TCPMon to inspect HTTP traffic, which was very handy for debugging web services(SOAP and other HTTP services). Basically it acted as a proxy forwarding the traffic to the target service while recording requests / responses and displaying via a Swing UI. It was a lifesaver for many projects that I’ve worked in.
Unfortunately TCPMon is not maintained anymore and it’s not very convenient to use in a containerized environment. Moreover I couldn’t find a simple plug&play alternative for the same purpose . For sure proxies like Nginx or HAProxy can easily monitor and log requests, but I didn’t find them very handy to configure for development. (I also found the Lua config a bit daunting to be honest)
So I decided to give a shot implementing a very simple proxy using Spring Boot+Kotlin. My initial idea was implementing a simple servlet to forward requests to a target host(which is passed as an environment variable, so it’d be easy to configure in a Docker compose environment as well). The servlet would log the requests to console while the traffic is passing through. That’s why I named it Passthru.
The Passthru Servlet was expected to process the incoming Http Request, recreating, dispatching, handling the response and logging handling all the encoding, headers, parameters and payload stuff. I wasn’t really comfortable with implementing all of l these by myself. These should be already solved by someone else who has more time and commitment than me.
Therefore I continued to dig a little more and came across Zuul by Netflix. I heard Zuul as an API Gateway but did not have a chance to try. Basically Zuul is an application level gateway and fortunately has direct integration with Spring. Moreover, Zuul provides a RequestContext object that enables developers to store request scoped data (in a Thread Local object).
I created a PassthruContext classes to record request response info which are as follows:
All I need to do seemed so simple:
Of course, it did not go as smoothly as I expected in the beginning. There were some hurdles that I had to tackle on the way. In the next sections I will go over the steps along with the glitches I had to address.
To make the most out of the benefits of offshore software development, you should understand the crucial factors that affect offshore development.
Check out these five criteria for the selection of your software vendor, and you will never regret having the wrong quality product made for you.
Wrestling betting software development solutions from expert Wrestling betting app and software development company delivers ultimate betting experience. Chat with us.
For a developer, becoming a team leader can be a trap or open up opportunities for creating software. Two years ago, when I was a developer, ... by Oleg Sklyarov, Fullstack Developer at Skyeng company
Become a developer - read about why software development is an ideal career. Software development is a future-proof career that will be in demand.