zhuhaow / NEKit

A toolkit for Network Extension Framework
https://zhuhaow.github.io/NEKit
BSD 3-Clause "New" or "Revised" License
2.84k stars 672 forks source link

使用NEKit能否完全使用tcp/udp的方式去代理呢? #271

Closed chenfengfeng closed 4 years ago

chenfengfeng commented 4 years ago

我想实现的效果是服务器收到的tcp请求,都是ip的请求,而不是现在http的请求。

比如我现在打开一个网页,那么我使用TUNInterface接收到的tcp数据,想实现传到服务器的,也是ip地址,而不是http的域名。 tcp/ip的上一层是http,我的猜想packetFlow拿到的数据应该也是ip加端口的模式吧。

对了,目前的情况是这样的,只有80或者443端口,服务器那边拿到的是域名,其他端口,tcp socket链接的服务器拿到的是ip+端口。

我可能解释的比较乱,不知道能不能理解我的意思

chenfengfeng commented 4 years ago

如果使用NEProxySettings的配置的话,是可以全部IP的方式去连接的

zhuhaow commented 4 years ago

https://developer.apple.com/documentation/networkextension/nepackettunnelflow

读出来的就是你要的,直接发过去就好了