Workaround on installing Android SDK 2.0 behind proxy requiring authentication
This morning I tried to install Android SDK 2.0 on my Ubuntu desktop. I downloaded the package with my browser without any problem. Extract it and then run tools/android to download the packages. Realising that my desktop requires a proxy which requires authentication to get to the Net, I went to the Settings panel of the Android SDK and AVD. There are only proxy host and port entries, no username and password entries. I was hoping that the software is smart enough to prompt for username and password later. However, I was wrong. It did not prompt me any authentication form whatsoever. Bummer...... Then I got an idea. I remember few months ago when I set up a forwarding only proxy to act as a child of a parent proxy. I thought if I could get this child proxy to authenticate to the parent proxy and forward all request to the parent proxy, the user won't need to authenticate at all. Hmmm.... Looking at the manual of squid http proxy, I saw cache_peer option which enable child proxy to login to the parent proxy by specifying login=username:password. Yummy.... So, I fired up the trusty apt-get to pull and install squid from my local repository.
$ sudo apt-get install squid $ sudo vi /etc/squid/squid.confThen I added the following setting:
cache_peer parent_proxy.company.domain parent 8080 0 no-query default login=username:password never_direct allow allThen I restart squid
$ sudo /etc/init.d/squid stop $ sudo /etc/init.d/squid startThen I pointed the Android SDK and AVD to use 127.0.0.1 and port 3128. I also set the software to force downloading using http even if the URL is in https. Finger cross and I tick the site and click Refresh. Viola... it works. It is downloading as I write this blog entries.
Comments
thank you!
thanks for the share
It was helpfull
Regards
i have tried this tutorial, here is the example :
cache_peer myproxy parent myport 0 no-query default login=myUser:myPasswd never_direct allow all
but i can not start squid :
root@ubuntu:~# /etc/init.d/squid restart
bash: /etc/init.d/squid: No such file or directory
I already install with :
apt-get install squid
i dont know how fix this, i am new in linux, but i'll learn it
# start squid
Some newer distributions are using upstart instead of Sys-V init. Btw, could you please inform me what distribution you are currently using? because they have different ways of doing things.