heiher / sockstun

A simple and lightweight VPN over socks5 proxy (tun2socks) for Android.
MIT License
274 stars 69 forks source link

请问安卓客户端的实现逻辑是什么 #18

Closed Cyberbolt closed 8 months ago

Cyberbolt commented 9 months ago

通过一定的方法调用系统 VPN 接口,然后使用 sockstun 将流量转发到 socks 5 Server,socks 5 Server 再转为 v2ray 等协议和远程代理服务器交互。这个 socks 5 Server 是运行在安卓本地的吗?监听的本地端口吗?有现成的方案推荐吗,谢谢!

heiher commented 8 months ago

socks5 server是否运行在项目本地视业务需求而定,如果需要本地分流或加密传输,那么socks5 server就要在本地(或是其镜像)。

当前项目就是一个足够精简的tun2socks使用示例了: https://github.com/heiher/sockstun/blob/master/app/src/main/java/hev/sockstun/TProxyService.java

Cyberbolt commented 8 months ago

socks5 server是否运行在项目本地视业务需求而定,如果需要本地分流或加密传输,那么socks5 server就要在本地(或是其镜像)。

当前项目就是一个足够精简的tun2socks使用示例了: https://github.com/heiher/sockstun/blob/master/app/src/main/java/hev/sockstun/TProxyService.java

谢谢,我只要调用这个 startService 方法,就会自动调用安卓的 VPNService 并把 Tun 流量转到我配置的 socks 端口吗?

heiher commented 8 months ago

socks5 server是否运行在项目本地视业务需求而定,如果需要本地分流或加密传输,那么socks5 server就要在本地(或是其镜像)。 当前项目就是一个足够精简的tun2socks使用示例了: https://github.com/heiher/sockstun/blob/master/app/src/main/java/hev/sockstun/TProxyService.java

谢谢,我只要调用这个 startService 方法,就会自动调用安卓的 VPNService 并把 Tun 流量转到我配置的 socks 端口吗?

没错。

Cyberbolt commented 8 months ago

@heiher 非常感谢!由于对原生开发尚不熟悉,再咨询下您。启用这个 VPNService 应该是将 TProxyService 实例化,然后调用 startService 方法吧?socks 5 服务器的 ip 和端口号是怎么传入的?

Cyberbolt commented 8 months ago

@heiher 非常感谢!由于对原生开发尚不熟悉,再咨询下您。启用这个 VPNService 应该是将 TProxyService 实例化,然后调用 startService 方法吧?socks 5 服务器的 ip 和端口号是怎么传入的?

看到了读文件。是需要在当前目录下放一个 conf 文件,这个文件就按您的项目文档配置吗?

heiher commented 8 months ago

@heiher 非常感谢!由于对原生开发尚不熟悉,再咨询下您。启用这个 VPNService 应该是将 TProxyService 实例化,然后调用 startService 方法吧?socks 5 服务器的 ip 和端口号是怎么传入的?

看到了读文件。是需要在当前目录下放一个 conf 文件,这个文件就按您的项目文档配置吗?

这些行就是在生成配置文件,配置文件按照 hev-socks5-tunnel 项目的 README 写就行。

Cyberbolt commented 8 months ago

@heiher 您好,能帮我看看这是什么问题吗?非常感谢

an issue