Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need help with Android Emulator Networking

Here is cmd line

"C:\Progra~2\Android\android-sdk\tools\emulator.exe" -avd Touch -netspeed full -netdelay none -http-proxy localhost:3128 -debug-proxy

here is console out when i try to open google.com from emulator:

server name 'localhost' resolved to 127.0.0.1:3128
proxy_http_setup: creating http proxy service connecting to: localhost:3128
server name 'localhost' resolved to 127.0.0.1:3128
proxy_http_setup: creating HTTP Proxy Service Footer is (len=2):
'
'
http_service_connect: trying to connect to (null)
http_service_connect: using HTTP rewriter
tcp:(null)(880): connecting
tcp:(null)(880): connected to http proxy, sending header
tcp:(null)(880): sending 27 bytes:
>> 43 4f 4e 4e 45 43 54 20 28 6e 75 6c 6c 29 20 48    CONNECT (null) H
>> 54 54 50 2f 31 2e 31 0d 0a 0d 0a                   TTP/1.1....

tcp:(null)(880): header sent, receiving first answer line
tcp:(null)(880): received 'HTTP/1.0 400 Bad Request'
tcp:(null)(880): connection refused, error=400
http_service_connect: trying to connect to (null)
http_service_connect: using HTTP rewriter
tcp:(null)(888): connecting

Here is exception from Wikitionary example debug

Caused by: java.net.ConnectException: en.wiktionary.org/91.198.174.232:80 - Connection refused

About my proxy: it is squid on my local machine and it is configured to route through parent proxy (with auth). This works fine with browser/Android SDK loader/IntelliJ etc., but emulator networking doesn't function.

The main confuse is

tcp:(null)

Any suggestions?

like image 903
skaeff Avatar asked Jul 21 '11 12:07

skaeff


1 Answers

There are a bunch of recorded issues with proxy support in the emulator, especially for recent versions on Windows. See the bug report here:

http://code.google.com/p/android/issues/detail?id=5508&q=emulator%20proxy&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars

There are some suggested workarounds in there which might help, like setting the proxy in the network settings instead of for the emulator as a whole.

like image 143
mikerowehl Avatar answered Oct 04 '22 03:10

mikerowehl