What is the best way to do this? I tried to use a ServerSocket and change my proxy setting port to send all traffic to my Java program. Well, it connects but I can't seem to read the request with clientSocket.readLine().
I don't want to know how to make my code work though, which is why I won't post the code. I want to know what the best way would be to intercept the HTTP request for reading. I'm guessing I will take an approach changing the proxy port to redirect traffic to my app (Like programs like Burp Suite and WebScarab do).
So in other words, can someone give me an example or pseudo code on how Burp Suite/WebScarab would read HTTP requests just by changing the proxy port?