Android 带有用户/密码的 Genymotion 代理
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20996772/
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
Genymotion proxy with user/password
提问by Sucata Mihnea
I'm running Android through Genymotion using the following configuration:
我使用以下配置通过 Genymotion 运行 Android:
- For the Host-Only I used 192.168.1.213 and DHCP allocates addresses starting with 192.168.1.214
- My computer is behind a Squid proxy that has user and password, and address 192.168.1.2 with port 4444
- 对于 Host-Only,我使用了 192.168.1.213 并且 DHCP 分配了以 192.168.1.214 开头的地址
- 我的计算机位于具有用户和密码的 Squid 代理后面,地址为 192.168.1.2,端口为 4444
I start the Android VM and in Genymotion Configuration I can see IP Management to be IP 192.168.1.214. I can also ping this address from my computer with success, so all good until here.
我启动了 Android VM,在 Genymotion 配置中,我可以看到 IP 管理为 IP 192.168.1.214。我也可以成功地从我的电脑 ping 这个地址,所以一切都很好,直到这里。
If I go to Menu -> Settings -> Wireless & Networks -> Wi-Fi -> WiredSSID -> Modify Network, I see IP address 10.0.3.15 - why is that?
如果我转到菜单 -> 设置 -> 无线和网络 -> Wi-Fi -> WiredSSID -> 修改网络,我会看到 IP 地址 10.0.3.15 - 为什么?
Also, if I try to configure proxy, all I get is host and port, but no options for user/pass, so when I try to access a page in the browser, it says that proxy authentication doesn't work.
此外,如果我尝试配置代理,我得到的只是主机和端口,但没有用户/密码选项,因此当我尝试访问浏览器中的页面时,它说代理身份验证不起作用。
Is there a way to configure Android to work through my proxy? If so, what should I configure?
有没有办法配置 Android 以通过我的代理工作?如果是这样,我应该配置什么?
Thank you
谢谢
回答by pcans
Your IP configuration looks correct. There is two connection between genymotion and your host.
您的 IP 配置看起来正确。genymotion 和您的主机之间有两个连接。
- The first one is only technical, to allow Genymotion to run (host only).
- The other one is the one that will be used when trying to get internet from Genymotion. (NAT)
- 第一个只是技术性的,允许 Genymotion 运行(仅限主机)。
- 另一种是在尝试从 Genymotion 获取互联网时将使用的一种。(NAT)
In Genymotion Settings, under proxy settings, you will be able to set your username & password for your proxy.
在 Genymotion 设置中,在代理设置下,您将能够为您的代理设置用户名和密码。
If you want to do more complex authentication schemes, like NTLM or Kerberos, Genymotion won't work. But as a workaround, you could use tools like Cntlm, or NtlmAps, that will provide a local, non authenticated, proxy and take care of upstream proxy authentication for Genymotion.
如果您想要执行更复杂的身份验证方案,例如 NTLM 或 Kerberos,则 Genymotion 将不起作用。但作为一种解决方法,您可以使用Cntlm或NtlmAps 之类的工具,它们将提供一个本地的、未经身份验证的代理,并负责 Genymotion 的上游代理身份验证。
This settings will only work for the sofware Genymotion. Inside Android, you will also need to set a proxy in the settings. Go to: Settings -> Wi-Fi -> Long Click on "WiredSSID" -> Modify network -> Check "show advanced settings".
此设置仅适用于软件 Genymotion。在 Android 中,您还需要在设置中设置代理。转到:设置 -> Wi-Fi -> 长按“WiredSSID” -> 修改网络 -> 勾选“显示高级设置”。
As mentionned there, the proxy will only works for the Browser, and maybe Gmail also. You will need to set it also on the settings of each app you trying to use. Not all of your apps will provide a proxy setting. I think Twitter does, but if your app doesn't provide one, you're screwed!
正如那里提到的,代理仅适用于浏览器,也可能适用于 Gmail。您还需要在您尝试使用的每个应用程序的设置中进行设置。并非所有应用程序都会提供代理设置。我认为 Twitter 有,但如果你的应用没有提供,那你就完蛋了!
回答by Dan B
I found a much simpler solution. All you have to do is to create a rule in proxifier which will let genymotion to use the host default ip. In this way it will manage to connect to the oracle virtual machine ( which has no problem with working with proxifier; obviously, in proxifier you will setup your proxy with its authentication credentials).
我找到了一个更简单的解决方案。您所要做的就是在 proxifier 中创建一个规则,让 genymotion 使用主机默认 ip。通过这种方式,它将设法连接到 oracle 虚拟机(使用 proxifier 没有问题;显然,在 proxifier 中,您将使用其身份验证凭据设置代理)。