From charlesreid1

Same content as Android Internet Tethering, but this page is not broken.

These notes are old but they may still work.

Internet Tethering

You can get internet tethering for free using a program called Proxoid (http://code.google.com/p/proxoid). It creates a proxy service, so that all internet requests from the computer are forwarded (via USB) to the phone, and the phone then forwards the request to The Interwebs.

This literally took me 30 seconds to set up. It's very, very simple if you've got the right tools.

1. First, you'll want the Android SDK kit, because you'll use it to send instructions to the phone. See #Installing Android SDK above.

2. Enable USB debugging on your phone: Settings > Application > Development > Enable USB Debugging

3. Open the Proxoid application on your phone. I'll assume you're using port 8080, but change it to any port you want.

4. Run this command to tell your phone to handle tcp traffic from your local computer to the Android phone:

$ adb forward tcp:8080 tcp:8080

Now, when your computer sends requests via port 8080, your phone knows how to handle it correctly.

You will need to run this command every time you want to use Proxoid!

5. Set proxy settings on your local machine so that IT knows to send requests via port 8080. See next section.

Setting Proxy Settings

You can do this a couple of different ways:

Proxy Option 1: Browser Only

Most modern browsers allow you to set proxy settings that are specific to the browser. I use (and recommend) Firefox, but other browsers will work too. First, pick Firefox > Settings > Advanced, and pick the "Network" tab:

FirefoxSettings.png

Click "Settings", and Firefox will allow you to configure proxy settings. You want to configure the proxy to be localhost and the port to be 8080:

FirefoxSettingsProxy.png

In normal-people speak, this tells your computer to route all internet requests through port 8080 of the local machine. Then, any requests to port 8080 are handled by the phone (well, by Proxoid) becuase of the "adb forward tcp:8080 tcp:8080" command you ran above.

Proxy Option 2: System-Wide

Still working this one out.

Proxy Option 3: SSH Tunnels

You can use a utility called Corkscrew available here: http://www.agroman.net/corkscrew/

Alternatively, you can use the ProxyTunnel utility available here: http://proxytunnel.sourceforge.net/

You can combine this tool with SSH tunnels to redirect traffic from any port through an SSH tunnel.

Following the Proxoid Linux users guide (http://code.google.com/p/proxoid/wiki/installationLinux), you can point SSH to the Corkscrew command by adding the following to ~/.ssh/config:

ProxyCommand /usr/local/bin/corkscrew localhost 8080 %h %p
ServerAliveInterval 10

Note that this will work even when SSHing to non-standard ports. If you run "ssh -p 12345 user@host", then it will pass "host" to "%h", and "12345" to "%p".

The ServerAliveInterval is required, because otherwise SSH connections will be closed after around 30 seconds. This sends a "keepalive" packet to the server every 10 seconds.