简体   繁体   English

使用 VpnService 的 Android http 隧道

[英]Android http Tunnel using VpnService

I'm trying to redirect the whole android network traffic through HTTP Tunnel, and there is no tutorial or Github Repository on how to do it.我正在尝试通过 HTTP 隧道重定向整个 android 网络流量,但没有关于如何执行此操作的教程或 Github 存储库。

Simply just get the host, port, username, and password from the user and tunnel the whole device to that host programmatically.只需从用户那里获取主机、端口、用户名和密码,并以编程方式将整个设备隧道连接到该主机。

I have configured an HTTP-Proxy server with squid, just need a client to connect to it.我已经用鱿鱼配置了一个 HTTP 代理服务器,只需要一个客户端来连接它。

I don't want an Open-VPN solution or StrongSwan, this app named TOOFAN Tunnel, is doing what exactly I need, but it's only available in some countries and it is not an open-source project.我不想要 Open-VPN 解决方案或 StrongSwan,这个名为 TOOFAN Tunnel 的应用程序正在满足我的需求,但它仅在某些国家/地区可用,并且它不是一个开源项目。

Just need someone to show me the path or put me in the right direction, I appreciate it in advance.只需要有人向我展示道路或让我朝着正确的方向前进,我提前表示感谢。

I know about Android's VpnServise , and how it redirects the traffic, I just don't know to implement a socket to transfer packets through an HTTP proxy with credentials.我知道 Android 的VpnServise ,以及它如何重定向流量,我只是不知道实现一个套接字来通过带有凭据的 HTTP 代理传输数据包。

I had built and tested more than 20 repositories but none worked.我已经构建并测试了 20 多个存储库,但没有一个有效。 Some of them are: SSLSocks , TunProxy , VpnProxy , SmartProxy , NetDroidProxy , LocalVPN , xSocks-android , prox .其中有些是: SSLSocksTunProxyVpnProxySmartProxyNetDroidProxyLocalVPNxSocks,机器人PROX

You can try using this library I made, it should allow you to do just about anything with Proxys or what not.您可以尝试使用我制作的这个库,它应该允许您使用代理做任何事情或不做任何事情。 I know its a very late response, however I hope it will help someone...我知道这是一个很晚的回应,但我希望它会帮助某人......

https://github.com/DrBrad/Android-VPN-to-Socket https://github.com/DrBrad/Android-VPN-to-Socket

https://github.com/DrBrad/JTun2Socks https://github.com/DrBrad/JTun2Socks

The simplest way to do so is by creating a DNS proxy for UDP packets and a TCP server for TCP packets.最简单的方法是为 UDP 数据包创建一个 DNS 代理,为 TCP 数据包创建一个 TCP 服务器。 You must manipulate the TCP packets to direct towards the new TCP server.您必须操纵 TCP 数据包以定向到新的 TCP 服务器。 You can pull the host and port by creating a simple nat session.您可以通过创建一个简单的 nat 会话来拉取主机和端口。

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

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