yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] slimfady:
using the above command works for me:

# http_proxy=http://10.1.44.111:80 /data/local/wget-binary --proxy-user='domain/user' --proxy-password=mypassword http://www.yahoo.com

http_proxy=http://10.1.44.111:80 /data/local/wget-binary --proxy-user='domain/user' --proxy-password=mypassword http://www.yahoo.com
--2010-09-29 09:38:10-- http://www.yahoo.com/
Connecting to 10.1.44.111:80... connected.
Proxy request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `index.html'

[ <=> ] 149,962 62.9K/s in 2.3s

2010-09-29 09:38:14 (62.9 KB/s) - `index.html' saved [149962]

Using the GUI does not,

Using the exact details (except for the single quotes for domain/user) gives me the message "Data Connectivity Problem" in browser. Here's the logcat output when enabling the GUI:

V/tproxy (10362): OnClickListner for ToggleButton - false
D/su (11192): 10151 com.hasbox.tproxy executing 0 /system/bin/sh using shell /system/bin/sh : sh
V/tproxy (10362): setchildrenstate - false
D/WifiService( 124): acquireWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@44b32158}
V/tproxy (10362): OnClickListner for ToggleButton - true
V/tproxy (10362): proxy.sh start type=http host=10.1.44.111 port=80 auth=true user=aramco/m*****d pass=*****
D/su (11216): 10151 com.hasbox.tproxy executing 0 /system/bin/sh using shell /system/bin/sh : sh
V/tproxy (10362): Successfully ran redirect.sh start
V/tproxy (10362): setchildrenstate - true
I/WidgetPrefs(10104): Loaded widget prefs for 24

(I'm a logcat noob, not sure if that's what you need)

Any suggestions?
[Desire Android Development] mlbl:
wget throws 'bad address..'. that's it. I even tried putting the IP of google.com, same problem. I guess this doesnt work at my office
[Desire Android Development] Zuecho:
The command above still doesnt work.

Are there any other ideas, how i can run transproxy automatically?
[Desire Android Development] eref:
It looks like it is working with Locale this way:

1. Install and configure Tproxy ;)

2. Install Locale and you will need two maybe three more plugins, too:

Locale SSID Plug-in and Locale Execute Plug-in and maybe Locale Cell plug-in

I made two situations in Locale:

a, Name: PROXY ON

Condition SSID - Your Accesspoint's SSID

or

Condition CELL - Let the plugin record the celtowers data near your location.

Settings Execute - /data/data/com.hasbox.tproxy/redirect.sh start

(if you use 2.04 tproxy: /data/data/com.hasbox.tproxy/redirect-start.sh)

b, Name: Defaults

Settings Execute - /data/data/com.hasbox.tproxy/redirect.sh stop

(if you use 2.04 tproxy: /data/data/com.hasbox.tproxy/redirect-stop.sh)
[Desire Android Development] Zuecho:
Now i tried it with Locale too.

I did it like you discribed but it wont work.

I also tried to activate Transproxy manualy over the console.

If i do this the proxy isnt activated and i get that message:

"FIX ME! implement getprotobyname() bionic/libc/bionic/stubs.c:378"
[Desire Android Development] BigEHokie:
Looks like my problem stems from Android not setting up all my networking configurations appropriately. Playing around with ifconfig, the netmask is different from other devices on the network as well as I can't see any default gateway assigned. The proxy server is on a different subnet so I can't ping it,etc without the gateway.

Been burning too many hours on this while at the client, I'm abandoning for the time being.

Dave -- Thanks for the (seemingly) great binary and thanks for your help trying to work through my issues. I'll probably return to this in the future as I'll be on this client for the next 3 months.
[Desire Android Development] fonix232:
Installed 3.02, and the not-working-after-restart bug disappeared. Now it's working perfectly, my only wish is now a new GUI :D
[Desire Android Development] daveba:
In your wget which worked you used a backslash and in the tproxy logcat you used a forwardslash (which clearly is wrong) ?
[Desire Android Development] melben:
Hi Dave

Your app is working perfectly for me still with authentication when I run it manually.

I was trying to use tasker with the Locale execute plugin to turn the proxy on when on my work wifi.

Is this the only script that needs to run?

/data/data/com.hasbox.tproxy/redirect.sh start

what about

/data/data/com.hasbox.tproxy/proxy.sh?

I set it up to run the script with the ! at the start and Super User prompts me to Allow but it doesn't seem to turn transproxy on. (the browser doesn't work and when I go into transproxy it appears off)

This is not necessarily a big deal as I turn wifi on manually using a widget, so I just have the transproxy icon next to it, but it would be nice to be able to do it automatically. A little On/Off widget could also be a nice addition.

Thanks

Ben
[Desire Android Development] eref:
Yes, you have right.

Today morning it did not start tproxy. I saw the script on my screen, so Locale run it but the tproxy did not start. I had to start it manually.

Sorry for that.
[Desire Android Development] daveba:
You only really need to stop the redirect script which redirects traffic to the proxy. You can keep the proxies running in the background if you like it shouldn't matter (although the feedback you'll get from the app is that it's running even though the redirection is stopped). If you want to be on the safe side and free up memory when it's not being used, then yes, stop both the scripts.
[Desire Android Development] melben:
OK, it works, fantastic. I misunderstood how I was supposed to use the scripts, keeping transproxy on and just adjusting the redirects. I was keeping transproxy off and expecting the scripts to start it.

For anyone trying to do this, keep transproxy on in the GUI and have the redirect start script execute to enable transproxy (I have it set to execute when wifi is on and ssid is ....) and have the redirect stop script execute to disable transproxy.

Thanks

Ben
[Desire Android Development] Zuecho:
Thanks Melben!

I had that problem too. Now I keep the button in the GUI on and only switch the redirect.sh.

In this way it works perfectly! Great!
[Desire Android Development] JurieK:
Can I just install the apk or do I need to run the commands aswell?
[Desire Android Development] JurieK:
When I try to start I get the following error: Failed to start redirect.sh (Permission Denied) What am I missing

HTC Desire
[Desire Android Development] JurieK:
Ok I got That sorted but when browsing I still get a error saying "Proxy needs Authentication" But my authentication is enabled and values is present and correct
[Desire Android Development] magdap:
just install the apk
[Desire Android Development] asmaridis:
Hello there,

I've been trying to get tproxy working but have been unsuccessful. I set the proxy server, port, and authentication and turned it on, then used Tasker to execute "/data/data/com..../redirect.ssh start" but still fail to get any results.

Any suggestions?

Thanks
[Desire Android Development] shokwaav:
i've been using 3.01 cos 3.02 doesn't work for me, im pretty sure its because it doesnt ask superuser for permissions...
[Desire Android Development] eref:
try ...redirect.sh start not ...redirect.ssh start.
[Desire Android Development] asmaridis:
Sorry it was a typo. I was trying redirect.sh not ssh. But I've been wondering, when I try to add a "!" at the beginning of the line, I never get asked for Superuser permissions.

Any more ideas?

EDIT: Alright just learnt about the existence of adb shell commands. Not sure if this helps but here's what I get:

/data/data/com.hasbox.tproxy/redirect.sh start

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

FIX ME! implement getprotobyname() bionic/libc/bionic/stubs.c:378
[Desire Android Development] [deXter]:
Thanks for this amazing app, just posting to let you know it works great (v3.02) on my HTC Desire with LeeDrOiD 2.1a!

I have a feature request though - is it possible to implement a local caching proxy? I ask because some apps I use on the phone frequently re-download the same information, without caching any of the data. As I'm on a very limited data cap (50MB!) this feature would be of immense help.

Looking forward for your responses, thanks!
[Desire Android Development] rogerin:
First, I would like to thank the developer to create this app. It is amazing and thank you!

However, on my Moto Milestone, it works greatly in the before it does not work currently with the error "Proxy failed to start". I have tried the method above and it does not resolve my issue.

I have not installed the other apps after using TransProxy. Any idea? Thank you very much!
[Desire Android Development] daveba:
The proble with a caching proxy is that it will fill up your internal/sdcard very quickly. It's specifically non-caching.
[Desire Android Development] daveba:
You're not rooted or have a old version of 'su' or have denied it in your super user access settings.
[Desire Android Development] daveba:
Possibly you're using NTLM auth or have a backslash or some other non-ascii character in your username/password ?
[Desire Android Development] daveba:
I do test my releases out. So definetly it does use su. I suggest you clear out the permission data from your superuser app.
[Desire Android Development] daveba:
As i've said in this thread. Ignore those errors. They are just warnings. The iptables will have started correctly. You can check by running

iptables -L -n -t nat
[Desire Android Development] daveba:
On your motorola is there a newer 'su' application you can upgrade to ? I changed the way 'su' is called so arguments can be passed to the script correctly. Before i was executing it with 'su -c' but now i am just executing 'su' and writing the shell arguments to stdin. I guess this change 'broke' older su implementations. In the next version+ i may just make the GUI call the iptables commands directly like in Transproxy 1 rather than calling the shellscript which seemed to work better for everyone.
[Desire Android Development] [deXter]:
Yep, but most proxies allow you to specify the cache size and a range of options, so is there any way one could achieve this? Maybe not directly through the actual transproxy program but by chaining it to a port of Squid or something lighter (if it exists)?
[Desire Android Development] daveba:
Well assuming you have a squid proxy to chain to, then why not ? Squid is too big a beast to work on low memory environments like a phone. You could chain it to 'wwwoffle'. Should be quite easy to compile if you download the NDK.
[Desire Android Development] asmaridis:
What's next to try then? And how would I know if your script actually works with my university's proxy server?

Thanks

EDIT: Currently I'm not on university campus so I can't test the proxy. However, I can find /system/bin/iptables if that means anything.
[Desire Android Development] daveba:
Huh ? I thought you already tested and it's working no ? I thought you were only wanting to start/stop it due to some location conditions ?
[Desire Android Development] asmaridis:
No the problem was that I couldn't get it to work in the first place. That is why I tried to start the redirect script. I'm not exactly an expert here so I'm going to need some help to get it working.
[Desire Android Development] BigEHokie:
I installed Froyo on my Captivate which had fixed the networking issue, so I figured I'd give this a try again. wget-binary worked, but I was receiving authorization errors. However, I put double quotes around my username and password and wget-binary is now working.

http_proxy=http://yourproxy:myport /data/local/wget-binary --proxy-user="mydomain\myuser" --proxy-password="mypass" http://www.yahoo.com

Transparent Proxy does not and I attempted with the latest version, 3.02.

So it seems like the escaping of the backslash \ is an issue in tproxy.
[Desire Android Development] badgerarc:
This works great for me using a University Eduroam Wifi connection that requires authentication. Well done!
[Desire Android Development] wl08:
After clean up superuser, 3.02 tproxy load on my phone. But still no luck.

My proxy works with wget but tproxy.

3.02 seems still fork large amount of connections which almost freezes my phone.
[Desire Android Development] tehownt:
Hello,

I have some trouble getting transproxy to work on my rooted 2.1 desire.

I will try wget next, but I just want to make sure transproxy is supposed to do what I intend it to...

What I want to do is open an SSH tunnel using connectbot and a socks proxy forwarding anything on a local port,

(the exact same thing as ssh -D <port> <host>)

then bind transproxy on 127.0.0.1 on the same port (in socks) so that any web request gets forwarded through SSH to the server where the tunnel is set.

Also, I want to use this over 3G.

So far the SSH tunnel works and I have been able to get transproxy 2.04 to work (it tells me it's "on") and the behaviour is different from when it's not running, but I get a timeout when loading pages... (I get access denied when not using transproxy, which is quite normal).

On the opposite side, transproxy 3.02 just core dumps w/ the error previously mentionned in the thread.

I would also have loved to try some other versions of transproxy (3.01, 3.00 etc.) if anyone can link to them it'd be great.

Gosh, I just wish there was a proxy option right in the f****** browsers...
[Desire Android Development] eref:
Hello Daveba,

3.02 does not start for me but 2.04 does. Any idea why?

Desire 2.2 stock rooted with unrevoked 3.21
[Desire Android Development] :
Just installed this on my evo, with Cyanogen's rom with the snap kernel, it asks for superuser, and it says ON but even if I put wrong credentials nothing happens...

I get no connection trying to use the browser... Am I doing something wrong?

Oh and using 3.02

EDIT: tried 2.04 and I keep getting socks protocal error 504

EDIT2: I think it works now after just putting my ip instead of host name on 2.04, except it's making my phone go incredibly slow...
[Desire Android Development] Ratmatix:
I just want to say that this is amazing. It works on the University of Melbourne's uniwireless with the following configuration:

Type: HTTP

host: wwwproxy.student.unimelb.edu.au

port: 8000

tick authentication

username: <username>

password: <password>

And it works from everything i've tried, so far. Market, maps, browser, etc.

Fantastic work!
[Desire Android Development] daveba:
Yes, i know this issue. It's fixed in my prebuild, but i'm out of the country with limited access to upload stuff. Expect 3.03 in the next day or two before the weekend.
[Desire Android Development] daveba:
See if you can update your 'su'
[Desire Android Development] daveba:
Yes, i noticed even with my throttling it is possible to get fork storms. I'm rewriting the redsocks to be be a transparent proxy so we can do away with two binaries and just concentrate on one codebase. Try out the next version and see if it's more memory friendly
[Desire Android Development] daveba:
First, ther *is* a proxy poption in the browser, but it only works in the browser (see any CM based ROM). It's an SQL setting so not easily accessible. However most people want more than just the browser to work. What google need to do is make this a global setting not just for the browser.

As mentioned transproxy 3.02 will segv if existing connections are existing and the bind() fails. This is fixed in the next version, but you can just run netstat to check any exisiting listener timing out on 8124. Once they have timed out you should be able to start it just fine.

Anyhow, i don't know why you are going through all this . If you already have a socks server, just enable the socks option and all should work. No need for ssh. I've tried it over 3g and all just works.
[Desire Android Development] Bradshort:
Froyo on Desire - Unrevoked rooted success!

Sterling work chaps. 3.02 did not work for me on a proxy wifi (no auth) but i tried the 2.04 and i can now connect to the net and market and twitter :)

Superb effort! Google should throw you some $$.
[Desire Android Development] daveba:
Can you tell me why 3.02 didn't work ? Did it crash, time out, not install ? I was going to delete all old versions but people seem to be having issues with 3.04 which i'm quite surprised about. i need to nail it down why it works for some and not others.
[Desire Android Development] Bradshort:
Well i have two issues. 3.02 installs ok but returned

'Failed to start proxy.sh (Bad address 1285652474.385986 redsocks.c:750

redsocks_init_instance(...) bind:Address already in use

[1] Segmentation fault ${DIR}/redsocks ...)'

when i tried to turn the service on.

2.04 on the other hand i have just installed ,allows me to browse market but not download from it.

I am willing to try another version.
[Desire Android Development] eref:
Same situation for me, Daveba
[Desire Android Development] daveba:
The bind() address already in use error is because you started and stopped it and then started it again without letting the sockets time out. This is a bug in the code, but if you wait a minute the sockets will time out and you will be able to start it correctly.
[Desire Android Development] flame10:
I was overjoyed to see 3.02 supporting market downloads .. but sadly cannot run the version, I don't get a superuser request and instead I get the message proxy failed to start.

I'm quite sure that this issue is due to the superuser request failure.. I have tried installing 2.04 and unistalling it after clearing data, but still same issue
[Desire Android Development] Bradshort:
i'll try it again for you
[Desire Android Development] daveba:
Can you not upgrade your 'su' ? http://xdaforums.com/showthread.php?t=682828
[Desire Android Development] Bradshort:
Just installed and i get the Proxy failed to start message
[Desire Android Development] daveba:
if you still get the 'bind' error, then do the following

ps |grep redsocks

and you may have a running 'redsocks' binary that you forgot to stop before you uninstalled. This means the PID file got deleted so we cannot now kill the old redsocks that is running (except by rebooting or a manual kill). So the above command should give you a line with the second coulmn being the PID. You can then use 'kill PID' . It's dirty, but should work.
[Desire Android Development] Bradshort:
hehe , yeh see thats when you lose me. Am new to this lark and have not entered any code anywhere before . . . Anyway, have rebooted.
[Desire Android Development] daveba:
;-) Clearly i need to make this more robust ! Lemme know if it works after reboot.
[Desire Android Development] Bradshort:
sorry did not work, still get Proxy failed to start on the 3.02 version.
[Desire Android Development] davecore:
Working like a charm....

Nothing to report sadly.... because :

It's working like a charm here !!

I am using 3.01 for now and I am able to connect to my 802.1x EAP at work without any issues and use the your proxy app to connect to everything I need... including and this is new (was not working with early versions) : Exchange !! I am able now to connect to ActiveSync without any issues... fast and working !

I want to thank you for this peace of magic's !!

WARM REGARDS FROM SWITZERLAND !

Dave'

Actual ROM : RCMix HD v5
[Desire Android Development] Bradshort:
Have reflashed the SU update and tried both 3.02 (still proxy failed to start) and 2.04.

2.04 is still allowing http and market access but still no downloading.

It is now being recognised by SU tho.

Having read this entire thread, you mentioned that certain ports may be blocked on the proxy. I can connect my laptop to the wifi too but how would i test Market to see if i can download from market on the lappie. Its not possible?
[Desire Android Development] daveba:
Still proxy failed to start on 3.02 ? Same bind() fault message ?

2.04 i think didn't have redsocks (port 443 forwarding) so no chance of it working on that. You have some chance on 3.02 if you're not blocked by your proxy server.
[Desire Android Development] Bradshort:
3.02 just will not start though. Get Proxy fail message first, try again and then get the bad address thingy
[Desire Android Development] STetzel:
which rom do you use. It seems theres a problem to find the PID ?

LeeDroid ?
[Desire Android Development] Bradshort:
I have a Vodafone Froyo phone that i have not changed in any way, accept to apply the root using unrevoked. So standard Vodafone rom
[Desire Android Development] tehownt:
Thanks for the reply,

I indeed have voted for the android option to add a global proxy and I hope it comes in 3.0 or someting...

I'm going through all that trouble because I want the connection to be secured, by SSH. Plus I don't have a socks server and thus running SSH provides me with one that works quickly, easily and is secure.

It's usually what people that use public wifi APs are recommended to do, tunnel through SSH and proxy everything through localhost.

I'll try and run netstat w/ the latest version and see what gives.
[Desire Android Development] daveba:
Nah, i think there is a flaw in my proxy.sh script start logic. The way it works is that the proxy.sh script is started with the start option and then exits as the processeses (tproxy and redsocks) are backgrounded but write a PID file in the data directory. It then only checks for a listener on port 8123 and if it doesn't find one, it flags up the failure (as it clearly failed to start the tproxy process to listen on 8123). It then kills both tproxy and redsocks. Subsequently if you try to restart it, (since redsocks actually started correctly in the previous start) you will get a bind error since the sockets are still timing out from the previous kill. Again if you wait for a minute you will not get the bind() failure, but you'll get a proxy.sh failed to start message (which is from tproxy failing). So the question is why is tproxy failing to start ?
[Desire Android Development] daveba:
You don't have a \ character in your user/pass ? Can you run

adb logcat

from a command window your pc and see what messages you get when you start the proxy.
[Desire Android Development] Bradshort:
I dont have a lead at work at the moment. But i do not have to autheniticate for the proxy, so no username or password required.
[Desire Android Development] flame10:
I'm already using su 2.3.6.1 , thats the latest version ... actually superuser is set to auto update
[Desire Android Development] STetzel:
V/tproxy ( 843): OnClickListner for ToggleButton - true
V/tproxy ( 843): proxy.sh start type=http host=192.168.26.8 port=8080 auth=true user=ste pass=*****
I/ActivityManager( 249): Starting activity: Intent { flg=0x10000000 cmp=com.noshufou.android.su/.SuRequest (has extras) }
W/ActivityManager( 249): Activity pause timeout for HistoryRecord{43f8bae0 com.hasbox.tproxy/.Main}
I/ActivityManager( 249): Displayed activity com.noshufou.android.su/.SuRequest: 111 ms (total 111 ms)
D/SuRequest( 675): Sending result: ALLOW for UID: 10079
D/su ( 1118): 10079 com.hasbox.tproxy executing 0 /system/bin/sh using shell /system/bin/sh : sh
D/dalvikvm( 249): JIT code cache reset in 8 ms (1048536 bytes 1/0)
D/dalvikvm( 249): GC_EXPLICIT freed 10518 objects / 458568 bytes in 69ms
V/tproxy ( 843): Successfully ran redirect.sh start
V/tproxy ( 843): setchildrenstate - true
W/IInputConnectionWrapper( 843): showStatusIcon on inactive InputConnection

i`ve no problem at all with 3.02
[Desire Android Development] Bradshort:
You can download from Market?
[Desire Android Development] asmaridis:
So daveba, could you shed some light on my issue?

I enter my proxy, port, and authentication, then press the ON button and get su permissions, but I just fail to connect to the internet (no browser, market etc... nothing).

However, using CM proxy settings, I do manage to connect using the browser.

Thanks
[Desire Android Development] liang3404814:
Nice to see the update, but 3.02 isn't working. It says "Proxy failed to start" when trying to enable and when I tried again it says

"Failed to start proxy.sh(Bad address 1286296277.268157 redsocks.c:750 redsocks_init_instance(...) bind: Address alreadyin use [1] Segmentation fault ${DIR}/redsocks ...)"