eycorsican / kitsunebi-android

A fully-featured V2Ray client for Android.
MIT License
1.76k stars 314 forks source link

新功能需求: 利用VpnService.Builder.addRouter和fake-ip,实现direct连接bypass vpn #141

Open ccaapton opened 4 years ago

ccaapton commented 4 years ago

目前android版中,需要走direct的连接也会被内核引至tun interface, 然后kitsunebi也需要对这些连接中的包进行逐个转发,比较浪费资源。

在采取fake-ip策略的前提下,我们可以把需要代理的domain全部fake至一个固定的ip range中,然后用addRoute 把这个ip range加入内核路由表,这样就只需要处理代理连接,而direct连接的数据包会被内核nat后直接交给底层interface,性能损失会大大降低。

rurirei commented 3 years ago

could you say details in more?

rurirei commented 3 years ago

We can fake all the domains that need to be proxied into a fixed ip range

it's considerable for only if definited domains proxy is needed, as this is much limited to do.