I am trying to write a http proxy server that would run on the device itself. In fact, need to find a way to capture the outbound http traffic generated by the device.
The code I have so far is compiling OK, it is based on the code found here: http://www.jtmelton.com/2007/11/27/a-simple-multi-threaded-java-http-proxy-server/
The problem is that the http request to the actual server would block and never return .
Is there a better way to write such a service without rooting the device?
All Android devices allow the configuring of proxy settings on Wi-Fi and mobile networks. You can access search engines and many apps using proxies.
A mobile proxy is a portable device — for example, a smartphone or a tablet — that has access to the internet via mobile data. You can connect to such proxies to mask your real IP address with the device's one.
You should check SandroProxy. Can caputre traffic on non rooted device if os proxy settings are used, or with iptables rules on rooted one. Traffic is stored it in local sqlite database. Captured data can be also examined by chrome devtools. To capture traffic in your app you should check source code for plugins. It has all the code for iptables redirections and proper settings.
Check out the wiki link on google source code HowToInterceptTrafficOnMyOwn
http://code.google.com/p/sandrop/wiki/HowToInterceptTrafficOnMyOwn
btw: send by sandroproxy support :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With