开发者

Is packet forwarding possible on Android?

开发者 https://www.devze.com 2023-04-06 10:44 出处:网络
Our requirement is to develop an Android App &/or service that does the following. Listen to http (port 80) requests/packets sent from the device (by any app). f开发者_如何学Pythonorward them to a

Our requirement is to develop an Android App &/or service that does the following. Listen to http (port 80) requests/packets sent from the device (by any app). f开发者_如何学Pythonorward them to a different server and not to the host that they are meant to go to.

Can someones please indicate whether this is possible and if yes, then how?


As android is a Linux system you might want to check redirection by using its iptables. However I assume that you might need root rights to do so.


It's possible on android versions 4.0 or greater with VPNService. Have a look at the ToyVpn example provided by google. It's not nice for the user as they get a popup and a constant icon on the notification bar, but it's possible.

If you only want port 80 you will have to decode the ip and tcp headers in your app.

0

精彩评论

暂无评论...
验证码 换一张
取 消