Socks proxy in android -


how connect socks proxy connection in android emulator, able connect socks proxy server on system browser not work in emulator, when using system network setting. have tried

system.setproperty("socksproxyhost", proxyhost); system.setproperty("socksproxyport", port); 

and

socketaddress addr = new inetsocketaddress(proxyhost, proxyport); proxy httpproxy = new proxy(proxy.type.socks, addr);urlconn = url.openconnection(httpproxy); 

but falied. want connect , consume socks proxy connection & web service in app on device.thanks in advance.

this works me on android 4.3 on rooted nexus 4 sshtunnel running:

    socketaddress proxyaddr = new inetsocketaddress("127.0.0.1", 1984);       socketaddress hostaddr = new inetsocketaddress(address, port);     java.net.proxy proxy = new java.net.proxy(java.net.proxy.type.socks, proxyaddr);     socket = new socket(proxy);     socket.connect(hostaddr); 

note: installed iptables beta i'm not sure if it's required.

for work emulator change ip 10.0.2.2 android's alias host machine. have run local socks proxy on machine of course.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -