Srar / node-tap

基于TypeScript实现的开源SSTap
Apache License 2.0
681 stars 150 forks source link

关于nat #67

Closed Accelerator-Li closed 5 years ago

Accelerator-Li commented 5 years ago

在开启代理后,使用NatTypeTester检测的结果是FullCone,但是在gtaol检测到的是Symmetric

NatTypeTester测试工具是https://github.com/HMBSbige/NatTypeTester 使用Wireshark抓包: 1 但是理论上如果nat类型是FullCone则应该会收到111.206.174.2的响应

Accelerator-Li commented 5 years ago

我在路由器上开ss全局代理,抓到了111.206.174.2的响应包,对应上图是第四个包,源地址是111.206.174.2而不是111.206.174.3,可能是您的程序返回数据包时写错了源地址?

Srar commented 5 years ago

在创建UDP会话时候会记录下 dst ip 后续ss服务端有传递任何数据包 src ip都会被重写为创建时候的dst ip

Accelerator-Li commented 5 years ago

假设A是自己,B和C是两个服务器,A访问B时留下B的ip记录,B访问A,src ip改为B的ip这没问题;但是C访问A,src ip被改为了B的ip,这不太好吧;如果能动态相应地填写src ip而不是所有数据包都重写第一个dst ip,这样就能实现FullCone了。有些游戏需要FullCone才能有比较好的游戏体验,如GTAOL

Srar commented 5 years ago

近日会推出新版本 不对src ip重写

Srar commented 5 years ago

我修改了个不对src ip重写的版本,麻烦测试下。

这个版本不包含依赖,麻烦请放在从releases下载解压的同目录运行。 sstap_nat.zip

Accelerator-Li commented 5 years ago

我测试了一下 GTAOL测到的是FULL CONE 3 但是NatTypeTester测到的却是PortRestrictedCone 4 然后我自己找了3个vps自己写了一段程序试了一下,发现并没有问题,A是SS Server 我通过A代理只发包给B,不发包给C,我也能收到C发给我的包,并没有问题,应该是NatTypeTester有bug。 然后我用https://github.com/jtriley/pystun 测试同一个STUN Server发现没有问题(stun.miwifi.com) 5

SmRiley commented 5 years ago

容我插一句,请问下不对src ip重写的版本对游戏的支持效果更好吗?

Accelerator-Li commented 5 years ago

容我插一句,请问下不对src ip重写的版本对游戏的支持效果更好吗?

类似于GTAOL的P2P模式的游戏应该会更好,像PUBG的C/S模式的游戏应该没有区别

SmRiley commented 5 years ago

容我插一句,请问下不对src ip重写的版本对游戏的支持效果更好吗?

类似于GTAOL的P2P模式的游戏应该会更好,像PUBG的C/S模式的游戏应该没有区别

感谢你的回复

Srar commented 5 years ago

感谢测试 我这再跑一段时间测试 如果没问题会打包一个版本发布

Srar commented 5 years ago

已发布1.34 如有NAT问题麻烦再次回复该issue