Click here to Skip to main content
Click here to Skip to main content

Android Usb Port Forwarding

, 26 Dec 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
This tool creates an USB tunnel between the android and the PC. The tunnel will forward communications to and from the host.

Download Windows part : - 3.2 MB
Download Android part - 99.04 KB

(See article in Portuguese here)

Important Update :

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

Android reverse tethering : 


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. 


  • Enable "Usb debuging" on your Android : Go to parameters / Applications / Development and check  "Usb debuging" 
  • Install "Usb Tunnel" on your Android (see donwnload link on top of the article) or from the market :
  • Screenshot - market.jpg

  • 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 : ( 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 :  
  • HTTPS server :  
  • 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 
  • Set network.proxy.http_port to 8080  
  • Set network.proxy.type to 1 (Manual). Default is 5 (system)  


  •  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. 


May 2011 : 

   First version  

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

   Android reverse tethering : 



This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Thierry Parent
Belgium Belgium
No Biography provided

Comments and Discussions

QuestionCan we use other apps like play store, watsapp using USB tunnel PinmemberMember 1149998111-Mar-15 2:11 
QuestionNo Device Detected XP SP3/Win7 Samsung GT-S7392 PinmemberMember 114300485-Feb-15 6:53 
QuestionHow to integrate usb tunnel to my project. Pinmemberlshl12430-Nov-14 1:26 
Questiondevice not being detected in win xp PinmemberMember 1097592828-Jul-14 4:06 
QuestionDevice Detection PinmemberMember 1097396227-Jul-14 1:37 
QuestionHI I HAVE NOTE 2 (NON ROOT) PinmemberHardik Jain11-Jul-14 9:03 
Questiondevice not detected PinmemberMember 108047728-May-14 9:14 
QuestionCan provide the source code? Pinmemberfeng li14-Mar-14 18:00 
Questionsource code PinmemberMember 1066255712-Mar-14 18:54 
QuestionSome queries Pinmembergrand_winner16-Feb-14 0:32 
AnswerRe: Some queries PinmemberThierry Parent16-Feb-14 4:21 
QuestionGetting apps other than Firefox to work PinmemberMember 1046679616-Dec-13 10:39 
AnswerRe: Getting apps other than Firefox to work PinmemberThierry Parent16-Dec-13 21:56 
Questiondevice not dected PinmemberMember 1041364420-Nov-13 4:11 
QuestionPlease give step by step tutorial... PinmemberMember 1041197419-Nov-13 7:38 
AnswerRe: Please give step by step tutorial... PinmemberThierry Parent19-Nov-13 22:20 
QuestionNon rooted PinmemberAmit Kumar11-Oct-13 3:41 
GeneralNot getting connected PinmemberMember 1032781610-Oct-13 3:49 
GeneralRe: Not getting connected PinmemberThierry Parent10-Oct-13 6:29 
AnswerConnection is always in waiting status PinmemberAmit Kumar7-Oct-13 1:57 
GeneralRe: Connection is always in waiting status PinmemberMember 105001413-Jan-14 6:10 
QuestionSocket Error #10054 [modified] PinmemberTarun Mudgal4-Oct-13 19:32 
QuestionCan't execute adb file PinmemberMember 1029303625-Sep-13 5:56 
QuestionDevice Detection PinmemberJamaldotAhmed21-Sep-13 12:37 
QuestionHow to establish connection PinmemberMember 1024661712-Sep-13 21:39 
AnswerRe: How to establish connection PinmemberThierry Parent12-Sep-13 22:59 
GeneralRe: How to establish connection [modified] PinmemberMember 1024661712-Sep-13 23:57 
GeneralRe: How to establish connection PinmemberThierry Parent13-Sep-13 4:37 
GeneralRe: How to establish connection PinmemberMember 1024661713-Sep-13 5:49 
Questionthx PinmemberAnthony Stéphan2-Sep-13 4:28 
AnswerRe: thx PinmemberThierry Parent2-Sep-13 5:42 
QuestionNot Worked PinmemberMember 1022521022-Aug-13 2:44 
GeneralMy vote of 5 Pinmembergabrielidev19-Aug-13 7:18 
QuestionGot it working on Galaxy SII on my windows 7 (usb to webserver host) PinmemberMember 859506012-Aug-13 5:52 
AnswerRe: Got it working on Galaxy SII on my windows 7 (usb to webserver host) PinmemberMember 1022917824-Aug-13 2:37 
GeneralRe: Got it working on Galaxy SII on my windows 7 (usb to webserver host) PinmemberThierry Parent24-Aug-13 22:36 
AnswerRe: Got it working on Galaxy SII on my windows 7 (usb to webserver host) PinmemberAATIF ALI KHAN7-Feb-14 2:42 
QuestionIp webcam port PinmemberStefan Novakovic8-Aug-13 5:23 
QuestionIn what mode i have to connect ? PinmemberNandha Nandy26-Jul-13 20:22 
QuestionWant to understand. PinmemberНикита Чехомов26-Jun-13 21:48 
AnswerRe: Want to understand. PinmemberThierry Parent26-Jun-13 22:50 
GeneralRe: Want to understand. PinmemberНикита Чехомов28-Jun-13 0:08 
QuestionNot able to use Android Usb Port Forwarding PinmemberPrateek Kumar12-Jun-13 22:10 
Questioni did the process in my galaxy mini s5570 PinmemberAdvait Trivedi12-Jun-13 20:15 
Questiondefualt gateway PinmemberAshish Mittal3-Jun-13 3:23 
QuestionSamsung S3 (not rooted), it worked for all apps! (Firefox, Whatsapp, facebook...) [modified] PinmemberMember 1001759229-Apr-13 5:15 
AnswerRe: Samsung S3 (not rooted), it worked! PinmemberKevin Jeremy8-May-13 1:18 
GeneralRe: Samsung S3 (not rooted), it worked! PinmemberMember 100175928-May-13 21:09 
GeneralRe: Samsung S3 (not rooted), it worked! PinmemberKevin Jeremy11-May-13 1:47 
GeneralRe: Samsung S3 (not rooted), it worked! PinmemberThierry Parent11-May-13 4:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150327.1 | Last Updated 26 Dec 2011
Article Copyright 2011 by Thierry Parent
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid