[TUT] HTTP Proxy through USB Cable

Search This thread

doixanh

Inactive Recognized Developer
Jan 23, 2011
1,263
5,314
Intro
Warning: this tutorial is highly technical for many users!

Yeah, as I mentioned in FroyoBread thread, we can use HTTP proxy via USB cable for Browsers and Maps (only in FroyoBread v011 and later) and some other apps (OperaMini for example). Market, Facebook and XDA app don't support Proxy though.

That means these apps can access the internet with an HTTP Proxy installed in your computer.

It's rather complicated, and platform-dependent (Linux or Windoze).

Requirements
  • High IQ!
  • A mini USB cable that connects your PC with your Phone!
  • Rooted
  • A ROM with dropbear included. All CM6/CM7 ROMs has dropbear already. SE's Eclair does NOT have dropbear.
  • adb (officially from android sdk)
  • FroyoBread v011 or higher for stock Browser and Maps
  • An SSH client in your PC, capable of client-2-server port forwarding


General instruction
These are general steps to show the idea. Don't worry, the specific part is below.
  • Install HTTP Proxy in your PC
  • Install an SSH client in your PC
  • Start adb server
  • Generate dropbear's rsa and dss keys in phone.
  • Start dropbear in phone.
  • Forward port 22 from your phone to port 2222 in your PC
  • From PC, ssh to localhost, port 2222 (that means ssh to phone's dropbear, port 22), enable client-2-server port forwarding for the proxy port
  • Configure proxy settings in phone
  • Enjoy

Linux
These instructions are specific for Linux. I assume that you use Ubuntu. Other distros should be similar. All of these commands are used in your PC.
  • Install HTTP Proxy in your PC. We use tinyproxy in this example.
    Code:
    $ sudo apt-get install tinyproxy
  • Install an SSH client in your PC. Ubuntu has ssh client (ssh) by default, but just in case you don't have that:
    Code:
    $ sudo apt-get install ssh
  • Start adb server
    Code:
    $ sudo adb kill-server
    $ sudo adb start-server
  • Generate dropbear's rsa and dss keys in phone.
    Code:
    $ adb shell mkdir -p /data/dropbear
    $ adb shell dropbearkey -t rsa -f /data/dropbear/dropbear_rsa_host_key
    $ adb shell dropbearkey -t dss -f /data/dropbear/dropbear_dss_host_key
  • Start dropbear in phone
    Code:
    $ adb shell dropbear
  • Forward port 22 from your phone to port 2222 in your PC
    Code:
    $ adb forward tcp:2222 tcp:22
  • From PC, ssh to localhost, port 2222 (that means ssh to phone's dropbear, port 22), enable client-2-server port forwarding for the proxy port 8080 (default with tinyproxy)
    Code:
    $ ssh localhost -p 2222 -R 8080:localhost:8080
  • Configure proxy settings in phone with these parameters:
    Code:
    Host: localhost
    Port: 8080
  • Enjoy
    Code:
    Try OperaMini (for other ROMs) or Browser and Maps included in FroyoBread


Windoze
Unfortunately I don't have Windoze right now. I will finish this part when I have access to a Windoze machine. Stay tuned.
 
Last edited:

mocilicious

Member
May 28, 2011
42
1
Omg this tutorial required a high IQ.
:p

Some problem will appear for me.
anyway this is show promise.
Thanks for the tutorial dx. Its awesome.
Let's do it

Sent from my X8 using XDA Premium App
 

UAL4588

Senior Member
Feb 16, 2011
266
28
West Lafayette
I'm thinking of making an all in one app for this... Don't know if this is possible, will look into it. Also would it be possible to apply this to the rom itself and make an option where if this option is enabled,we could channel all net traffic through the browser which would effectivly mean reverse usb tethering. Don't know if its possible though


Sent from my X8 using XDA App
 

Dare-Devil Inside

Senior Member
Apr 5, 2011
1,054
363
Sibenik
You are right because I read win -do -ze when I read Windows right this win-dovs.
Not same think.

Sent from my X8 using XDA Premium App

double-facepalm_56304.png
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    Intro
    Warning: this tutorial is highly technical for many users!

    Yeah, as I mentioned in FroyoBread thread, we can use HTTP proxy via USB cable for Browsers and Maps (only in FroyoBread v011 and later) and some other apps (OperaMini for example). Market, Facebook and XDA app don't support Proxy though.

    That means these apps can access the internet with an HTTP Proxy installed in your computer.

    It's rather complicated, and platform-dependent (Linux or Windoze).

    Requirements
    • High IQ!
    • A mini USB cable that connects your PC with your Phone!
    • Rooted
    • A ROM with dropbear included. All CM6/CM7 ROMs has dropbear already. SE's Eclair does NOT have dropbear.
    • adb (officially from android sdk)
    • FroyoBread v011 or higher for stock Browser and Maps
    • An SSH client in your PC, capable of client-2-server port forwarding


    General instruction
    These are general steps to show the idea. Don't worry, the specific part is below.
    • Install HTTP Proxy in your PC
    • Install an SSH client in your PC
    • Start adb server
    • Generate dropbear's rsa and dss keys in phone.
    • Start dropbear in phone.
    • Forward port 22 from your phone to port 2222 in your PC
    • From PC, ssh to localhost, port 2222 (that means ssh to phone's dropbear, port 22), enable client-2-server port forwarding for the proxy port
    • Configure proxy settings in phone
    • Enjoy

    Linux
    These instructions are specific for Linux. I assume that you use Ubuntu. Other distros should be similar. All of these commands are used in your PC.
    • Install HTTP Proxy in your PC. We use tinyproxy in this example.
      Code:
      $ sudo apt-get install tinyproxy
    • Install an SSH client in your PC. Ubuntu has ssh client (ssh) by default, but just in case you don't have that:
      Code:
      $ sudo apt-get install ssh
    • Start adb server
      Code:
      $ sudo adb kill-server
      $ sudo adb start-server
    • Generate dropbear's rsa and dss keys in phone.
      Code:
      $ adb shell mkdir -p /data/dropbear
      $ adb shell dropbearkey -t rsa -f /data/dropbear/dropbear_rsa_host_key
      $ adb shell dropbearkey -t dss -f /data/dropbear/dropbear_dss_host_key
    • Start dropbear in phone
      Code:
      $ adb shell dropbear
    • Forward port 22 from your phone to port 2222 in your PC
      Code:
      $ adb forward tcp:2222 tcp:22
    • From PC, ssh to localhost, port 2222 (that means ssh to phone's dropbear, port 22), enable client-2-server port forwarding for the proxy port 8080 (default with tinyproxy)
      Code:
      $ ssh localhost -p 2222 -R 8080:localhost:8080
    • Configure proxy settings in phone with these parameters:
      Code:
      Host: localhost
      Port: 8080
    • Enjoy
      Code:
      Try OperaMini (for other ROMs) or Browser and Maps included in FroyoBread


    Windoze
    Unfortunately I don't have Windoze right now. I will finish this part when I have access to a Windoze machine. Stay tuned.
    2
    Look here. It's a slang to refer to Windows. I'm not a fan of Windows. LOL.
    2
    You are right because I read win -do -ze when I read Windows right this win-dovs.
    Not same think.

    Sent from my X8 using XDA Premium App

    double-facepalm_56304.png
    1
    as mario you are very desperate boy:D:D:D:D