简体   繁体   English

如何在 android 中设置代理 VPN?

[英]How to setup a proxy VPN in android?

I want to connect to an HTTP proxy like this 95.179.128.75:8080 and tunnel all phones like ultrasurf app .我想连接到像这样的 HTTP 代理95.179.128.75:8080并隧道所有手机,如ultrasurf app I try to make a Vpn Service with these codes:我尝试使用以下代码创建 Vpn 服务:

class MyVpnService : VpnService() {

override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {

    Builder().setSession("MyVPNService")
        .addAddress("95.179.128.75:8080", 24)
        .addDnsServer("8.8.8.8")
        .addRoute("0.0.0.0", 0).establish()

    return Service.START_STICKY
}

}

But it doesn't work and I didn't find any source for connection to the proxy.但它不起作用,我没有找到任何连接到代理的来源。 Can you help me???你能帮助我吗???

I am not sure if the above, would work我不确定上述是否可行

See this example VPN implementation for global proxy TunProxy that should give some idea请参阅这个用于全局代理TunProxy的示例 VPN 实现,它应该给出一些想法

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

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