简体   繁体   English

通过身份验证的代理在Android设备上进行Internet访问

[英]Internet access on Android device behind proxy with authentication

I am unable to connect to the Internet through android emulator 2.2 which is behind a proxy that requires proxy authentication. 我无法通过需要代理身份验证的代理后面的android emulator 2.2连接到Internet。

Searched a lot over the Internet to find a proper solution but none of them are working for me. 在Internet上进行了大量搜索以找到合适的解决方案,但没有一个对我有用。

I am running the emulator on a Ubuntu machine. 我在Ubuntu机器上运行模拟器。

Situation: I have an application which is designed to run on both ubuntu(linux) and android. 情况:我有一个设计用于在ubuntu(linux)和android上运行的应用程序。

This application has a feature to connect to internet by providing proxy details and it connects properly when run on ubuntu after providing correct details. 此应用程序具有通过提供代理详细信息连接到Internet的功能,并且在提供正确的详细信息后在ubuntu上运行时可以正确连接。 however this fails to connect through the emulator. 但是,这无法通过仿真器连接。 Even the web browser on the emulator doesn't connect to internet. 甚至模拟器上的Web浏览器都无法连接到Internet。 Doing some changes in APN settings, it atleast gave me a webpage saying that the ISA server needs authentication, but never got any popup requesting to enter those details. 在对APN设置进行了一些更改之后,它至少给了我一个网页,说ISA服务器需要身份验证,但是从未出现任何弹出窗口要求输入这些详细信息。

By applying -debug-proxy flag to emulator, the logs showed that it is trying to connect to the requested proxy server, but the server is challenging with authentication and none of the applications seem to get a chance to fill in this details and hence failing. 通过将-debug-proxy标志应用于仿真器,日志表明它正在尝试连接到请求的代理服务器,但是服务器在身份验证方面存在挑战,并且所有应用程序似乎都没有机会填充此详细信息,因此失败。 This is what is happening with my application. 这就是我的应用程序正在发生的事情。

Does anyone have any clue why this could be happening and how i can resolve this issue? 有谁知道为什么会发生这种情况以及我如何解决此问题? Thanks in advance. 提前致谢。

PS This is happening on actual android devices as well, so it may not be the problem of just the emulator. PS这也是在实际的android设备上发生的,因此可能不仅仅是模拟器的问题。

Puneet ... Do as viv said and along with this give proxy address in its IP format instead of giving its DNS name. Puneet ...按照viv的指示进行操作,并以IP格式而不是DNS名称来提供代理地址。 I have read some where that it is having problem in resolving DNS name. 我读过一些解析DNS名称时遇到问题的地方。

您可以使用Proxy Manager应用程序从经过身份验证的代理后面连接到Internet。

Tell me if I'm wrong but I think Puneet is talking about wifi connection. 告诉我是否有误,但我认为Puneet在谈论wifi连接。 So the solution is not to configure an APN as it's for mobile networks. 因此,解决方案不是像在移动网络中那样配置APN。 I got the same problem and I'm still searching for a solution... 我遇到了同样的问题,我仍在寻找解决方案...

There is a simple method by which you can get internet access on the device but only for browsing. 有一种简单的方法可以使您在设备上访问互联网,但仅用于浏览。 Except the browser no other apps will have access to internet. 除浏览器外,没有其他应用程序可以访问互联网。 You can find detailed information on http://androidproxy.blogspot.in/2011/01/setting-up-proxy.html . 您可以在http://androidproxy.blogspot.in/2011/01/setting-up-proxy.html上找到详细信息。

In order to get the IP address just ping the proxy server in your organisation. 为了获取IP地址,只需对组织中的代理服务器执行ping操作。 By default the port is 8080. 默认情况下,端口为8080。

Try this: 尝试这个:

Go to setings -> wireless and networks -> Mobile networks -> Access point name. 转到设置->无线和网络->移动网络->接入点名称。

If you see any entry here, edit it's settings 如果您在此处看到任何条目,请对其设置进行编辑

if you use webview, you can override onReceivedHttpAuthRequest method of webviewclient when set it. 如果使用webview,则可以在设置它时重写webviewclient的onReceivedHttpAuthRequest方法。

    mWebView.setWebViewClient(new WebViewClient() {
        @Override
        public void onReceivedHttpAuthRequest(WebView view,HttpAuthHandler handler,String host, String realm) {
            handler.proceed("username", "password");
        }
        });

我知道这是一篇过时的文章,但仅对于问同样问题的人来说,我确实通过使用现在在android市场中的Autoproxy应用从代理网络中的手机进行连接,需要身份验证: https ://market.android.com /details?id=com.mgranja.autoproxy_lite&feature=search_result&rdid=com.mgranja.autoproxy_lite&rdot=1&pli=1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM