4

i'm using ADB with command

adb shell settings put global http_proxy <ip>:<port>

it's works very good .

but i can't login proxy if it had protected with username and password

please help me if you know anything .

Tkiet
  • 41
  • 1
  • 3

1 Answers1

4

I made some investigation and find out correct settings to enable http proxy with authentication via adb:

adb shell settings put global http_proxy 192.168.225.100:3128
adb shell settings put global global_http_proxy_host 192.168.225.100
adb shell settings put global global_http_proxy_port 3128
adb shell settings put global global_http_proxy_username foo
adb shell settings put global global_http_proxy_password bar

And to disable proxy:

adb shell settings delete global http_proxy
adb shell settings delete global global_http_proxy_host
adb shell settings delete global global_http_proxy_port
adb shell settings delete global global_http_proxy_username
adb shell settings delete global global_http_proxy_password
adb shell settings delete global global_http_proxy_exclusion_list
adb shell settings delete global global_proxy_pac_url
adb shell reboot

Unfortunately it is not working in my Wear OS wristwatch. May be you'll be more lucky.

kvaps
  • 2,589
  • 1
  • 21
  • 20
  • answer works, but for me not. I use an automatic proxy configuration url with user and password needed (.pac) how I set that? – Xaren Jan 06 '21 at 21:34
  • Quick question, does "with authentication" means it needs authentication or this code can bypass it? – DialFrost Aug 15 '22 at 09:03