简体   繁体   English

从 Android 访问 Web-Services 可通过 Web 上的 VPN 访问

[英]Accessing Web-Services from Android which are accessible through VPN on Web

I have a application i know how to consume web services i am up with a challenge and lack of knowledge on network side, The Web Services are accessible through VPN on Web which is protected with Credentials.我有一个应用程序,我知道如何使用 web 服务我面临挑战并且在网络方面缺乏知识,Web 服务可通过 ZC6E190B284633C48E39E55049DA3CCEZ 上的 VPN 访问,受凭据保护。

I am looking around connecting VPN Service here and tried the sample look, poked around OPENVPN and ToyVPN,我在 这里四处寻找连接 VPN 服务并尝试了示例外观,在 OPENVPN 和 ToyVPN 周围戳了一下,

My Question is do i need a VPN service to consume the web services or is their something which i am missing because i do not have much of knowledge regarding this.我的问题是我需要 VPN 服务来使用 web 服务还是我缺少的东西,因为我对此没有太多了解。

Below is the code i am using as i mentioned earlier VPN server has Creds but the method below i am using returns me isConnected true even though i haven't provided the Creds.下面是我使用的代码,正如我之前提到的,VPN 服务器具有 Creds,但即使我没有提供 Creds,我使用的下面的方法也会返回 isConnected true。

 builder.addAddress(ServerAddress, 24)
                        .addDnsServer("8.8.8.8")
                        .addRoute("0.0.0.0", 0).establish();

                InetSocketAddress server = new InetSocketAddress(
                        ServerAddress, portNumber);

You should not need to add VPN implementation in your app.您不需要在应用中添加 VPN 实现。 You will need to find out from Web service author, which VPN app (available on Play store) you should use to setup VPN beforehand.您需要从 Web 服务作者处了解,您应该使用哪个 VPN 应用程序(可在 Play 商店中获得)来预先设置 VPN。 Once your VPN is connected, your app should be able to access the web service.连接 VPN 后,您的应用应该能够访问 web 服务。

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

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