Android 2.0.1 emulator: Not able to get Proxy settings to work (tried -http-proxy and APN proxy)

915 views
Skip to first unread message

Clark Hunter

unread,
Dec 4, 2009, 1:19:00 PM12/4/09
to Android Developers
This link has some suggestions for proxy setting for early (pre-1.5)
and later (1.5 thru 1.6) Android emulators:
http://www.coderanch.com/t/462906/Android/Mobile/connect-internet-behind-proxy

Basically, the older emulator used a “com.android.provider.setting.db”
database or -http-proxy command line switch to set proxy/port/userid/
password.

Android 1.5 and 1.6 used: Home->Menu->Settings->WirelessControls-
>MobileNetworks->Access Point Names to set multiple proxy/port/userid/
password configurations.
My 1.6 emulator is working behind our corporate firewall/proxy.

Android 2.0 has some issue where the APN didn't display.
I used sqlite3 /data/data/com.android.providers.telephony/databases/
telephony.db to manually set fields and make the entries editable
(current=1).
I could access local servers, but not get thru the firewall?

Android 2.0.1 shows the APN with a default 'TelKila' entry. I can add
my proxy information, but still can't get past the firewall (shows Web
page not available)?

David Turner

unread,
Dec 4, 2009, 8:10:40 PM12/4/09
to android-d...@googlegroups.com
Try using the -http-proxy <proxy> option when starting the emulator.
This implements a transparent HTTP proxy that doesn't need modifying settings in the emulated system at all.
It used to be buggy in previous releases of the emulator (mainly when used with MS proxy servers) but this should
have been fixed in the latest SDK Tools release.

If this still doesn't work, try to use -debug-proxy as well, this will dump the proxied traffic, and send it here so I can
have a look at it.

Also see -help-proxy for details about the <proxy> parameter.

Hope this helps.


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-d...@googlegroups.com
To unsubscribe from this group, send email to
android-develop...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Clark Hunter

unread,
Dec 7, 2009, 9:03:08 AM12/7/09
to Android Developers
I had tried -http-proxy before without success. My command line:
Emulator -avd Android201 -debug-proxy -http-proxy http://<uid>:<pwd>@10.0.6.251:3128

Initial startup console messages:
proxy_http_setup: creating http proxy service connecting to:
10.0.6.251:3128
server name '10.0.6.251' resolved to 10.0.6.251:3128
proxy_http_setup: creating HTTP Proxy Service Footer is (len=55):
'Proxy-authorization: Basic <Base64UidPwd>

If I open a link to a GOOD connection inside the firewall, I see:
http_service_connect: trying to connect to 10.10.0.252:80
http_service_connect: using HTTP rewriter
tcp:10.10.0.252:80(1416): cannot connect to proxy: <unknown error>
adb logcat doesn't show any unusual messages.

If I do a BAD connection (e.g. google), I don't see any console
messages?
adb logcat shows:
E/browser ( 192): onReceivedError -2 http://www.google.com/ The URL
could not be found.

again, my Android 1.6 emulator works with the APN settings and didn't
honor the -http-proxy setting.
On Dec 4, 8:10 pm, David Turner <di...@android.com> wrote:
> Try using the -http-proxy <proxy> option when starting the emulator.
> This implements a transparent HTTP proxy that doesn't need modifying
> settings in the emulated system at all.
> It used to be buggy in previous releases of the emulator (mainly when used
> with MS proxy servers) but this should
> have been fixed in the latest SDK Tools release.
>
> If this still doesn't work, try to use -debug-proxy as well, this will dump
> the proxied traffic, and send it here so I can
> have a look at it.
>
> Also see -help-proxy for details about the <proxy> parameter.
>
> Hope this helps.
>
> On Fri, Dec 4, 2009 at 10:19 AM, Clark Hunter <chbrigh...@gmail.com> wrote:
> > This link has some suggestions for proxy setting for early (pre-1.5)
> > and later (1.5 thru 1.6) Android emulators:
>
> >http://www.coderanch.com/t/462906/Android/Mobile/connect-internet-beh...
>
> > Basically, the older emulator used a “com.android.provider.setting.db”
> > database or -http-proxy command line switch to set proxy/port/userid/
> > password.
>
> > Android 1.5 and 1.6 used:  Home->Menu->Settings->WirelessControls-
> > >MobileNetworks->Access Point Names to set multiple proxy/port/userid/
> > password configurations.
> > My 1.6 emulator is working behind our corporate firewall/proxy.
>
> > Android 2.0 has some issue where the APN didn't display.
> > I used sqlite3 /data/data/com.android.providers.telephony/databases/
> > telephony.db to manually set fields and make the entries editable
> > (current=1).
> > I could access local servers, but not get thru the firewall?
>
> > Android 2.0.1 shows the APN with a default 'TelKila' entry. I can add
> > my proxy information, but still can't get past the firewall (shows Web
> > page not available)?
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-d...@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-develop...@googlegroups.com<android-developers%2Bunsu...@googlegroups.com>

WebUX1

unread,
Dec 16, 2009, 2:33:08 AM12/16/09
to Android Developers
Hi, I am also experiencing this same issue where G1.6 emulator proxy
works with APN settings but trying to use G2.0 fails to access the
internet (APN fails, -http-proxy fails).

I have tried the above recommended steps - all with the same result
"Web page not available"

My debug proxy output for Clark:
D:\Android\Android-2.0\tools>emulator.exe -avd Android201AVD -debug-
proxy -http-proxy 10.0.2.2:8888
emulator: WARNING: 4: missing expected assignment operator (=).
line ignored
proxy_http_setup: creating http proxy service connecting to:
10.0.2.2:8888
server name '10.0.2.2' resolved to 10.0.2.2:8888
proxy_http_setup: creating HTTP Proxy Service Footer is (len=2):
'
'
http_service_free

D:\Android\Android-2.0\tools>

On Dec 7, 6:03 am, Clark Hunter <chbrigh...@gmail.com> wrote:
> I had tried -http-proxybefore without success. My command line:
> Emulator -avd Android201 -debug-proxy-http-proxyhttp://<uid>:<pwd>@10.0.6.251:3128
>
> Initial startup console messages:
> proxy_http_setup: creating httpproxyservice connecting to:
> 10.0.6.251:3128
> server name '10.0.6.251' resolved to 10.0.6.251:3128
> proxy_http_setup: creating HTTPProxyService Footer is (len=55):
> 'Proxy-authorization: Basic <Base64UidPwd>
>
> If I open a link to a GOOD connection inside the firewall, I see:
> http_service_connect: trying to connect to 10.10.0.252:80
> http_service_connect: using HTTP rewriter
> tcp:10.10.0.252:80(1416): cannot connect toproxy: <unknown error>
> adb logcat doesn't show any unusual messages.
>
> If I do a BAD connection (e.g. google), I don't see any console
> messages?
> adb logcat shows:
> E/browser (  192): onReceivedError -2http://www.google.com/The URL
> could not be found.
>
> again, myAndroid1.6 emulator works with the APN settings and didn't
> honor the -http-proxysetting.
> On Dec 4, 8:10 pm, David Turner <di...@android.com> wrote:
>
>
>
> > Try using the -http-proxy<proxy> option when starting the emulator.
> > This implements a transparent HTTPproxythat doesn't need modifying
> > settings in the emulated system at all.
> > It used to be buggy in previous releases of the emulator (mainly when used
> > with MSproxyservers) but this should
> > have been fixed in the latest SDK Tools release.
>
> > If this still doesn't work, try to use -debug-proxyas well, this will dump
> > the proxied traffic, and send it here so I can
> > have a look at it.
>
> > Also see -help-proxyfor details about the <proxy> parameter.
>
> > Hope this helps.
>
> > On Fri, Dec 4, 2009 at 10:19 AM, Clark Hunter <chbrigh...@gmail.com> wrote:
> > > This link has some suggestions forproxysetting for early (pre-1.5)
> > > and later (1.5 thru 1.6)Androidemulators:
>
> > >http://www.coderanch.com/t/462906/Android/Mobile/connect-internet-beh...
>
> > > Basically, the older emulator used a “com.android.provider.setting.db”
> > > database or -http-proxycommand line switch to setproxy/port/userid/
> > > password.
>
> > >Android1.5 and 1.6 used:  Home->Menu->Settings->WirelessControls-
> > > >MobileNetworks->Access Point Names to set multipleproxy/port/userid/
> > > password configurations.
> > > My 1.6 emulator is working behind our corporate firewall/proxy.
>
> > >Android2.0 has some issue where the APN didn't display.
> > > I used sqlite3 /data/data/com.android.providers.telephony/databases/
> > > telephony.db to manually set fields and make the entries editable
> > > (current=1).
> > > I could access local servers, but not get thru the firewall?
>
> > >Android2.0.1shows the APN with a default 'TelKila' entry. I can add
> > > myproxyinformation, but still can't get past the firewall (shows Web
> > > page not available)?
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "AndroidDevelopers" group.
> > > To post to this group, send email toandroid-...@googlegroups.com
> > > To unsubscribe from this group, send email to
> > >android-develop...@googlegroups.com<android-developers%2Bunsubs­cr...@googlegroups.com>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en- Hide quoted text -
>
> - Show quoted text -

Aaron Li

unread,
Dec 28, 2009, 3:56:23 AM12/28/09
to Android Developers
Hello, is it possible to set http proxy on real device with Android
2.0.1?
-http-proxy only available for emulator :(

Best regards,
Aaron

On 12月16日, 下午3時33分, WebUX1 <web...@gmail.com> wrote:
> Hi, I am also experiencing this same issue where G1.6 emulatorproxy

> works withAPNsettings but trying to use G2.0 fails to access the


> internet (APNfails, -http-proxyfails).
>
> I have tried the above recommended steps - all with the same result
> "Web page not available"
>

> My debugproxyoutput for Clark:
> D:\Android\Android-2.0\tools>emulator.exe -avd Android201AVD -debug-proxy-http-proxy10.0.2.2:8888


> emulator: WARNING:    4: missing expected assignment operator (=).
> line ignored

> proxy_http_setup: creating httpproxyservice connecting to:


> 10.0.2.2:8888
> server name '10.0.2.2' resolved to 10.0.2.2:8888

> proxy_http_setup: creating HTTPProxyService Footer is (len=2):


> '
> '
> http_service_free
>
> D:\Android\Android-2.0\tools>
>
> On Dec 7, 6:03 am, Clark Hunter <chbrigh...@gmail.com> wrote:
>
>
>
> > I had tried -http-proxybefore without success. My command line:
> > Emulator -avd Android201 -debug-proxy-http-proxyhttp://<uid>:<pwd>@10.0.6.251:3128
>
> > Initial startup console messages:
> > proxy_http_setup: creating httpproxyservice connecting to:
> > 10.0.6.251:3128
> > server name '10.0.6.251' resolved to 10.0.6.251:3128
> > proxy_http_setup: creating HTTPProxyService Footer is (len=55):
> > 'Proxy-authorization: Basic <Base64UidPwd>
>
> > If I open a link to a GOOD connection inside the firewall, I see:
> > http_service_connect: trying to connect to 10.10.0.252:80
> > http_service_connect: using HTTP rewriter
> > tcp:10.10.0.252:80(1416): cannot connect toproxy: <unknown error>
> > adb logcat doesn't show any unusual messages.
>
> > If I do a BAD connection (e.g. google), I don't see any console
> > messages?
> > adb logcat shows:
> > E/browser (  192): onReceivedError -2http://www.google.com/TheURL
> > could not be found.
>

> > again, myAndroid1.6 emulator works with theAPNsettings and didn't


> > honor the -http-proxysetting.
> > On Dec 4, 8:10 pm, David Turner <di...@android.com> wrote:
>
> > > Try using the -http-proxy<proxy> option when starting the emulator.
> > > This implements a transparent HTTPproxythat doesn't need modifying
> > > settings in the emulated system at all.
> > > It used to be buggy in previous releases of the emulator (mainly when used
> > > with MSproxyservers) but this should
> > > have been fixed in the latest SDK Tools release.
>
> > > If this still doesn't work, try to use -debug-proxyas well, this will dump
> > > the proxied traffic, and send it here so I can
> > > have a look at it.
>
> > > Also see -help-proxyfor details about the <proxy> parameter.
>
> > > Hope this helps.
>
> > > On Fri, Dec 4, 2009 at 10:19 AM, Clark Hunter <chbrigh...@gmail.com> wrote:
> > > > This link has some suggestions forproxysetting for early (pre-1.5)
> > > > and later (1.5 thru 1.6)Androidemulators:
>
> > > >http://www.coderanch.com/t/462906/Android/Mobile/connect-internet-beh...
>
> > > > Basically, the older emulator used a “com.android.provider.setting.db”
> > > > database or -http-proxycommand line switch to setproxy/port/userid/
> > > > password.
>
> > > >Android1.5 and 1.6 used:  Home->Menu->Settings->WirelessControls-
> > > > >MobileNetworks->Access Point Names to set multipleproxy/port/userid/
> > > > password configurations.
> > > > My 1.6 emulator is working behind our corporate firewall/proxy.
>

> > > >Android2.0 has some issue where theAPNdidn't display.


> > > > I used sqlite3 /data/data/com.android.providers.telephony/databases/
> > > > telephony.db to manually set fields and make the entries editable
> > > > (current=1).
> > > > I could access local servers, but not get thru the firewall?
>

> > > >Android2.0.1shows theAPNwith a default 'TelKila' entry. I can add


> > > > myproxyinformation, but still can't get past the firewall (shows Web
> > > > page not available)?
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "AndroidDevelopers" group.
> > > > To post to this group, send email toandroid-...@googlegroups.com
> > > > To unsubscribe from this group, send email to

> > > >android-develop...@googlegroups.com<android-developers%2Bunsub s­cr...@googlegroups.com>


> > > > For more options, visit this group at

> > > >http://groups.google.com/group/android-developers?hl=en-Hide quoted text -

Aaron Li

unread,
Jan 3, 2010, 10:42:07 PM1/3/10
to Android Developers
After some studying, i found following code segment in Brower's
source:

//
// start MASF proxy service
//
//Intent proxyServiceIntent = new Intent();
//proxyServiceIntent.setComponent
// (new ComponentName(
// "com.android.masfproxyservice",
// "com.android.masfproxyservice.MasfProxyService"));
//startService(proxyServiceIntent, null);

Does that imply the browser won't consider proxy anymore?

Best regards,
Aaron

> > > > >http://groups.google.com/group/android-developers?hl=en-Hidequoted text -

Reply all
Reply to author
Forward
0 new messages