Archive

Posts Tagged ‘Development’

Android Proxy support

May 25th, 2011 No comments

So, last week I found myself immersed in Android again, figuring out for a client to what extend Android can support proxies. For future posterity, I’ve written this post to document what I found.

User-level proxy support

Proxy support under Android is somewhat of a mixed bag. What you will find is that is it possible to setup a proxy server for your 3G connection, but that it is not possible to setup a proxy connection for your WiFi or VPN connection. A system-wide proxy cannot be setup as well. Mind you, this is based on what is possible under the default Android settings. The Samsung Galaxy S, for example, does support the use of a system-wide proxy, but this is a Samsung-addition.

A 3G proxy can be set via the APN settings (Settings →Wireless Controls→Mobile Networks→Access Point Names, then select the active APN):

Edit APN settings

This does give you a proxy for the 3G connection you are currently using, but most probably you want to use a proxy for your WiFi. As  of this moment (September 2010), this is not possible without rooting your handset. I won’t go into the details of that operation, as there are many sites dealing with that issue. Instead, I’d like to point you to Xda Developers, whose many forums are bound to contain rooting instructions for your particular Android handset.

If you do have a rooted phone, you can use a tool called.
It is possible to have a UI popup that handles the configuration of a proxy for wifi but the settings that it stores are harshly discarded by Android when it configures a network connection.

One thing is for certain: Google needs to step up to the plate to make Android proxy friendly if it wants to break into the enterprise market.

Categories: Android, Linux Tags: ,

Git through proxy….

June 4th, 2009 No comments

To access the Android code from my laptop at work I need to go through a proxy. I had a hard time finding info on how to use git with a proxy, but then I found this link detailing a script that uses socat to get through a proxy. The sample script they provided did half of the work of connecting to the proxy. However, it didn’t handle the authentication part. Fortunately, socat has a few more tricks up its sleeve and adding a proxyauth option handles this case as well.  Full script can be found below:

#!/bin/sh
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
#
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config --global core.gitproxy gitproxy

# Configuration. Common proxy ports are 3128, 8123, 8000.
PROXY=yourproxy
PROXYPORT=8080
PROXY_AUTH=username:password

exec socat STDIO PROXY:$PROXY:$1:$2,proxyport=$PROXYPORT,proxyauth=$PROXY_AUTH

Be aware that your proxy must allow outbound connections to port 9418! If not, this script will not work

Categories: Linux Tags:
Easy AdSense by Unreal