Local proxy running on an Android device

I am trying to write an http proxy that will run on the device itself. In fact, you need to find a way to capture the outgoing HTTP traffic generated by the device.

The code I'm still compiling OK 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 will be blocked and not returned.

Is there a better way to write such a service without rooting the device?

+6
source share
3 answers

You should check out SandroProxy. It can cache traffic on an unmanaged device if os proxy settings are used, or with iptables rules on the root. Traffic is stored in the local sqlite database. Captured data can also be examined using chrome devtools. To capture traffic in your application, you must check the source code for the plugins. It has all the code to redirect iptables and the correct settings.

Check out the wiki link in google source code HowToInterceptTrafficOnMyOwn

http://code.google.com/p/sandrop/wiki/HowToInterceptTrafficOnMyOwn

btw: send sandroproxy support :)

+4
source

I am using a piece of software called proxydroid to use my device as a proxy server, and its the only one I found that does not require root. I'm not sure if this will help you, but his open source project and code can be found here:

https://github.com/madeye/proxydroid

I noticed that the application will freeze after a while or if a large number of requests are sent immediately, but I did not have the opportunity to find out why this is happening.

0
source

Forget about setting up a proxy, use the Facebook Stetho library ( http://facebook.imtqy.com/stetho/ ) to view all HTTP requests and responses from the emulator / device

enter image description here

0
source

Source: https://habr.com/ru/post/954897/


All Articles