Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android http Tunnel using VpnService

I'm trying to redirect the whole android network traffic through HTTP Tunnel, and there is no tutorial or Github Repository on how to do it.

Simply just get the host, port, username, and password from the user and tunnel the whole device to that host programmatically.

I have configured an HTTP-Proxy server with squid, just need a client to connect to it.

I don't want an Open-VPN solution or StrongSwan, this app named TOOFAN Tunnel, is doing what exactly I need, but it's only available in some countries and it is not an open-source project.

Just need someone to show me the path or put me in the right direction, I appreciate it in advance.

I know about Android's VpnServise, and how it redirects the traffic, I just don't know to implement a socket to transfer packets through an HTTP proxy with credentials.

I had built and tested more than 20 repositories but none worked. Some of them are: SSLSocks, TunProxy, VpnProxy, SmartProxy, NetDroidProxy, LocalVPN, xSocks-android, prox.

like image 942
Mojtaba Razaghi Avatar asked Aug 11 '19 21:08

Mojtaba Razaghi


1 Answers

You can try using this library I made, it should allow you to do just about anything with Proxys or what not. I know its a very late response, however I hope it will help someone...

https://github.com/DrBrad/Android-VPN-to-Socket

https://github.com/DrBrad/JTun2Socks

The simplest way to do so is by creating a DNS proxy for UDP packets and a TCP server for TCP packets. You must manipulate the TCP packets to direct towards the new TCP server. You can pull the host and port by creating a simple nat session.

like image 104
DrBrad Avatar answered Sep 19 '22 01:09

DrBrad