[Android Apps and Games] lionhe:
Proxy with authentication apparently not working

Phone: rooted Nexus S.

Stock Rom with 2.3.6

Version of Autoproxy-lite 0.57.1

issue: not able to browse internet: gives Error server not responding.

The proxy at my work requires authentication. With Opera mobile by setting the proxy address and the right port in the opera:config page I can surf the web. A window pops up asking for username and password: once I type them I can browse the web.

With autoproxy, even though I supply the credentials it seems as if they were not given to the server.

Trying to debug, I issued the iptables commands for testing, and I obtained the following answers

su

# iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to 8123

iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to 8123

getsockopt for multiport failed strangely: No such file or directory

getsockopt for multiport failed strangely: No such file or directory

FIX ME! implement getprotobyname() bionic/libc/bionic/stubs.c:378

# iptables -L -n -t nat

iptables -L -n -t nat

getsockopt for multiport failed strangely: No such file or directory

getsockopt for multiport failed strangely: No such file or directory

Chain PREROUTING (policy ACCEPT)

target prot opt source destination

Chain OUTPUT (policy ACCEPT)

target prot opt source destination

REDIRECT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 redir po

rts 8123

Chain POSTROUTING (policy ACCEPT)

target prot opt source destination

#

The iptables version is 1.3.7.

There are no connection logs in

/data/data/com.mgranja.autoproxy_lite/app_logs

The resdsocks app is running (ps | grep redsocks gives a process owned by root)

While the proxy is on, the iptables -L -n -t nat gives

# iptables -L -n -t nat

iptables -L -n -t nat

getsockopt for multiport failed strangely: No such file or directory

getsockopt for multiport failed strangely: No such file or directory

Chain PREROUTING (policy ACCEPT)

target prot opt source destination

Chain OUTPUT (policy ACCEPT)

target prot opt source destination

ACCEPT tcp -- 0.0.0.0/0 xx.xx.xx.xx tcp dpt:8080

ACCEPT tcp -- 0.0.0.0/0 172.16.0.0/12

ACCEPT tcp -- 0.0.0.0/0 10.0.0.0/8

ACCEPT tcp -- 0.0.0.0/0 192.168.0.0/16

REDIRECT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 redir ports 8123

REDIRECT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 redir ports 8124

REDIRECT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5228 redir ports 8124

Chain POSTROUTING (policy ACCEPT)

target prot opt source destination

(I have edited the proxy ip address)

By the way, the proxy actually DOES something, probably forwarding some other ports, because the skype application works. It really seems related to authentication.

Is the trouble related to the error message

getsockopt for multiport failed strangely: No such file or directory

getsockopt for multiport failed strangely: No such file or directory

I've seen that log is disabled by default: How is it possible to switch it on?

Another question: does the lite version of the app requirs ads? But if the proxy does not work, the ads cannot be downloaded: maybe is this causing the troubles?

Thank you for your help,

PS. After some experimenting I figured out how to generate logfiles. The trouble apparently is that the authentication does not work. But username and passwords are correct, because they work in opera.

1323094839.915544 redsocks.c:604 redsocks_accept_client(...) [192.168.219.101:39973->173.194.35.63:80]: accepted

1323094839.920653 redsocks.c:279 redsocks_start_relay(...) [192.168.219.101:56359->111.184.149.73:443]: data relaying started

1323094839.937170 http-relay.c:169 httpr_relay_read_cb(...) [192.168.219.101:39973->173.194.35.63:80]: proxy auth failed

1323094839.937269 redsocks.c:289 redsocks_drop_client(...) [192.168.219.101:39973->173.194.35.63:80]: dropping client

1323094839.939589 redsocks.c:604 redsocks_accept_client(...) [192.168.219.101:58117->173.194.35.63:80]: accepted

1323094839.973165 http-relay.c:169 httpr_relay_read_cb(...) [192.168.219.101:58117->173.194.35.63:80]: proxy auth failed

1323094839.973271 redsocks.c:289 redsocks_drop_client(...) [192.168.219.101:58117->173.194.35.63:80]: dropping client

Sometimes it begin downloading a page, but soon it gives a network error.

--------------------------------------------------------------------------

Another afternoon of experiments: I uninstalled it and tried with proxydroid (v.2), which uses more or less the same redsocks executable and scripts. Same problem. BUT, using an old version (1.84 found on another forum) it connects smoothly! This means that there is something wrong with the current version of the redsocks binary.