Android 代理设置是否适用于设备上的所有应用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24417242/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 08:06:17  来源:igfitidea点击:

Do Android proxy settings apply to all apps on the device?

androidproxy

提问by Micro

If you set up proxy settings for an android device, do they apply to all apps on the device including the browser? Or do they only apply to the browser?

如果您为 Android 设备设置代理设置,它们是否适用于设备上的所有应用程序,包括浏览器?还是它们只适用于浏览器?

The reason I ask is that when you go to change the proxy settings on an android device there is this message, and it is confusing me:

我问的原因是,当您在 android 设备上更改代理设置时,会出现此消息,这让我感到困惑:

"HTTP proxy use by browser but may not be used by other applications"

回答by Julian Jocque

No, they do not apply globally and without root there is no way to force a proxy to be used by all applications. The reason the message you found is worded that way is that it is up to the app creator to respect the proxy settings and use them or do the wrong thing and ignore them.

不,它们不适用于全局,如果没有 root,则无法强制所有应用程序使用代理。您发现的消息是这样措辞的原因是应用程序创建者应该尊重代理设置并使用它们,或者做错事并忽略它们。

If you happen to be rooted, you can use this appwhich will apply the proxy settings to all apps and activities.

如果您恰好是 root,则可以使用此应用程序,它将代理设置应用于所有应用程序和活动。

The reason that this is not the default behavior is because it could present some security risks. If all traffic could be redirected, users could have all of their traffic be going through some bad proxy server that snoops on them so they default to only allowing apps to use proxy if they explicitly ask for it.

这不是默认行为的原因是因为它可能会带来一些安全风险。如果所有流量都可以重定向,那么用户的所有流量都可能通过某个监视他们的不良代理服务器,因此他们默认只允许应用程序在明确要求时使用代理。

回答by MSS

Try postern. It redirect all the traffic to a local vpn and support:

试试postern。它将所有流量重定向到本地 vpn 并支持:

  • SSH Tunnel
  • Shadowsocks
  • SOCKS5 Proxy
  • HTTPS/HTTP CONNECT
  • SSH隧道
  • 影袜
  • SOCKS5 代理
  • HTTPS/HTTP 连接

You can find it here:

你可以在这里找到它:

https://play.google.com/store/apps/details?id=com.tunnelworkshop.postern

https://play.google.com/store/apps/details?id=com.tunnelworkshop.postern

and more similar apps like it here:

以及更多类似的应用程序:

https://android.izzysoft.de/applists.php?topic=cat;id=109

https://android.izzysoft.de/applists.php?topic=cat;id=109

回答by rustyMagnet

as Julian said, some apps or SDKs inside apps are not Proxy aware.

正如 Julian 所说,应用程序中的某些应用程序或 SDK 不支持代理。

I experienced this first hand with an SDK. I couldn't understand why it was not showing up my Burp tool. I eventually found out that it was proxy unaware.

我通过 SDK 亲身体验了这一点。我不明白为什么它没有显示我的 Burp 工具。我最终发现它是代理不知道的。

As Julian said, you can use an Android app to fix this. An alternative - I used - invisible proxying. Have a look at: https://portswigger.net/burp/help/proxy_options_invisible.html

正如朱利安所说,您可以使用 Android 应用程序来解决此问题。另一种选择 - 我用过 - 隐形代理。看看:https: //portswigger.net/burp/help/proxy_options_invisible.html

回答by Nick Wright

Not sure what apps will or won't use the proxy. I have a couple of Android apps and they ignored it.

不确定哪些应用程序会或不会使用代理。我有几个 Android 应用程序,但他们忽略了它。

I got around this by using an app called drony, which doesn't require the device to be rooted. I have a few apps and they all happily proxied to drony without having to do anything to the app. I then set drony to proxy to fiddler on my local machine. Instructions to set this up are all here: Setup global proxy in your android device without rooting!

我通过使用一个名为 drony 的应用程序解决了这个问题,该应用程序不需要植根设备。我有一些应用程序,它们都愉快地代理到 drony,而无需对应用程序做任何事情。然后我将 drony 设置为代理到我本地机器上的 fiddler。设置说明都在这里: 在您的Android设备中设置全局代理,无需root!

回答by Martin Alderson

This isn't correct. Nearly all apps will respect HTTP proxy settings. Xamarin.Android often doesn't but you can override this in your webclient.

这不正确。几乎所有应用程序都会遵守 HTTP 代理设置。Xamarin.Android 通常不会,但您可以在您的网络客户端中覆盖它。

PS: If this fails you can use wireshark in all cases to do this.

PS:如果失败,您可以在所有情况下使用wireshark来执行此操作。