Important Update :

Introduction

The Android architecture does not allow to start communication from the Android to the host through the USB cable.The opposite is possible, using the Google "Android Debug Bridge" (ADB in short).

This tool will act as a tunnel between the Android client application and the host server. It is a software implementation of a router doing IP port forwarding.

On the Host part, you have to declare the ports you want to be opened on the Android and the tunnel will transfer communications between the android and the host. The host can be any server on the network or your local host.

Prerequisits

Install "Usb Tunnel" on your Android (see donwnload link on top of the article) or from the market :

Install the host windows application (see download link on top of the article)
or this skydrive link or this GDoc link

On the configuration panel, enter the path to the ADB program. ADB is part of the Android SDK. The installation includes the minimum files required.

Add tunnels. Each tunnel is composed of a name, an Android port (low port like 80 can't be used), a host IP and a host port (can be different from the android port)

HTTP proxy

If Tethering is a technology that allows you to use the mobile internet connection on your PC, this tool gives you the opposite. It's a sort of Reverse Tethering.

You can now surf on your mobile (using the internet connection on your PC) through the Usb tunnel and via a proxy.

If you are on a company network, ask your administrator what IP adddress and port he is using for the proxy. In some cases it can be the default gateway (run ipconfig command at the DOS prompt to find out what the default gateway is).

If you are on a private network and you have no clue about the proxy adress and port, you can use a public proxy (do search for "Public proxy" on the internet). To help you out, here is link to a list of proxies.

Another possibility is to install a local http proxy server like squid.

Step 1 : configure the windows part. Since low ports can't be used, you should use a different high port for the android and another port for the host.

Sample configuration for a company network : (192.168.xxx.xxx) on port 80

Sample configuration for a public internet proxy on port 8080

Step 2 : Connect he USB cable (of course). Click the refresh button to display your device in the device list then click connect. The Android Usb tunnel service will start in the background. A connection icon will be added on the notification pannel.

Step 3 : Setup your browser to use a proxy. Depending on the version of your Android OS, it's possible to define a http proxy in the advanced wifi settings menu (Not tested, available in some Android, but not all).

Normal Chrome browser

I didn't find a way to get it working. Forget about TransparentProxy, ProxyDroid or AsProxy. that require Root and don't work

Opera mobile

Enter opera:config in the address bar

Expand the proxy line

HTTP server : 127.0.0.1:8080

HTTPS server : 127.0.0.1:8080

Use HTTP : checked

Use HTTPS : checked

Click "Save"

Firefox Mobile

Enter about:config in the address bar

In the search filter (below address bar), enter "proxy"

Set network.proxy.http to 127.0.0.1

Set network.proxy.http_port to 8080

Set network.proxy.type to 1 (Manual). Default is 5 (system)

Skyfire

I didn't find a way to get it working.

Step 4 : Enjoy! enter any URL on your browser. Your firewall may detect that AndroidTool.exe is trying to access the internet. Give him the rights to access the proxy.

In this screenshot, you can see the number of active connections , closed connections, total bytes transfered (to and from)

I checked with an internet speed test. It's just a little bit slower.

History

May 2011 :

First version

Decembre 2011 : For rooted phone, you can use my other program (not yet on codeproject) :

Hi Thierry,
Thanks your great app.
I want to integrate this app to my specail VNC project,could you tell me how should i do?
As i know,generally android device can't act as host mode machine,so i don't know how the VNC viewer on android device connect to VNC server on pc.
Could you help me custom your project if you don't want to open source code.
My requirement is :
PC Side:
1.Launch app and then connect android device auto via USB.
2.Create proxy server like "127.0.0.1 7689".

Hello, I couldn't get any device listed. If you could help please reply. My device is a Micromax Bolt A58 and the USB cable i am using is that of a HTC Wildfire. If I need to change anything please reply.

im was trying the mentioned process in internet cafe on Windows XP but in vain since the pc on which i was working was not using any proxy. Also im very new to android and not tech savvy so need the procedure in simple ways..Please as i got few apps which are big in size n reverse tether is the only way i can download those apps.

Hi! I'd like to thank you for writing this piece of code, but I have encountered a couple problems trying to use it. My wireless device stopped working recently on my Samsung Galaxy S2, and i encountered this article while looking for a workaround or some way to fix it. While I tried to follow your instructions to the T, unless I use proxy software, I cant get internet access on my phone. Also, I cant seem to get other apps to use the internet. Can anyone help me? Id really like to be able to use Whatsapp in particular

Thanks for sharing this wonderful thing with us.
But whenever i am trying to connect, the connection is established but it is always in waiting status.
Please tell me why this thing is happening and what could be the solution?
My Android Port is: 8092
Host Address is: 127.0.0.1
I also tried with default gateway, which is: 192.168.1.1
Android Port Status is: Waiting
Host Port Status is: Not Connected
Please Help Me..

Moreover, In the program it says connected (in rare tries) at the left hand side of "Show Android Interface" but in status it still shows the status as "Unknown" and (on the right hand side) "Not Connected".

Great job. I think that the missing piece is detection of android devices by PC wich deals with a very wide range of hardware drivers (I suppose). Personally I use a third party freeware to get my tablet identified (ADB -TABLET or something alike should be viewed on Device Manager), then comes your wonderful master piece. So idea is combing your apps with a some Sync. software.

I have installed AndroidTool.exe (which I believe is portable exe and can be launched by just clicking this file) and have entered Myconnection details as host and adroid port 8080, IP: 127.0.0.1 and have also launched Tracetool service.apk on Android Samsung Note II device. There it shows services running and asking us to connect from Windows PC. On PC side when I connect, it says error: No device found. On PC side Refresh Devices doesn't show any device. What error have I made. At my place broadband net ADSL router is connected to LAN switch and my PC and other PCs here are also connected to the same LAN switch. All PCs here are able to use internet. I wish to do reverse tether to Note II and use net on it. We have no proxy set up here. All PCs have gateway and default DNS IP entered as 192.168.x.x which is the LAN side IP of the ADSL router. Pls guide.