header custom & fix dialerProxy with finalmask/udp#5657
header custom & fix dialerProxy with finalmask/udp#5657
Conversation
|
|
|
|
|
|
( |
已经可以了,只是无法搭配 dialerProxy, |
|
|
|
|
嗯,我也只测试了 dialerProxy 部分, |
|
看了下 Splice 对于出站只需要读方向的 raw conn,对于入站只需要写方向的 raw conn,而 header-custom 和 fragment 都满足这一要求,所以可以直接默认 tcpmask 支持解 wrap 简单测试了下 tcp header-custom 以及有无 tcpmask 的 splice 下的行为和之前一样 明天再测下 udp 的 header-custom 以及 conn 清理细节方面应该就可以了
|
1ca3c57 to
f66ed82
Compare
|
改了下,去掉 OnCloseHeaderError,增加 ServersError,可选在不同 clients 位置过来的数据不对时回应的不同错误 |
|
header-custom 的话直接照抄 noises 吧有 str 方便些,如果 rand 就只读取长度、不验证内容 顺便把 fragment 和 noises break 过来吧,
|
|
Wait 不太需要单独 noise,就放 header-custom 的 UDP 里,可以加个选项 times,1 的话就是只发一次,带 delay 的话就是单独发 |
|
header-custom 的 TCP 同理也要加 delay 这个选项,不 delay 的话要粘包发送,都先等有数据吧确保 delay 的准确性 值得注意的是 header-custom UDP 有 delay 时两端可以不同,可能就出站/入站先发几个包给 GFW 演一下, |
|
对于 UDP 就默认它可能会丢包然后有 delay 的就是不验证对端包吧,比如入站写了 client 但有 delay,只发自己 server 的就行 |
CopyRawConnIfExist 只在 freedom 出站和 xtls 里用到,freedom 里在 responseDone,获取 inbound 的 conn 用 tc.ReadFrom 如果有,ReadFrom 也只是影响这个流的写,读不会影响,所以出站只需要 unwrap 后的 read,入站只需要 unwrap 后的 write
合一起也可以,我想的是可以在整个连接周期只发一次,或者可设置重置时间,感觉已经打通的四元组再发没啥意义 |
|
Splice 的话你可能没看 ReadFrom() 里的实现,Linux 要知道两端的 fd 才能对拷,不然实际上是基于 buffer 的 copy,没用到 Splice
|
哦哦,
都改成 str 吗,我怀疑 str 能否表示完全 0-255,还有对于中文不知道用的是啥编码 |
|
tcp 流粘包不太好实现,不知道后面会接收多少才会到下一个包头 |
|
我看了一下 好像ack帧不受mtu限制 一个ACK帧会发出最多128个报文序号 一个序号4字节 最后加上帧头开销的一些零碎就是五百多 |
|
搭配这个跑不起来才对啊,
|
|
|
|
我先去测试下 |
|
|
|
如果说 ackNumberLimit 同时也是最大非连续包缓存数的话,降低它可能会影响吞吐量, |
|
mtu自动算一下AckNumberLimit就好 我也是这么想的 |
|
|
|
|
|
|
|
|
|
|
|
|
|
@LjhAUMEM 测了还会有超过预设 MTU 的情况吗 |
|
clean 和 writeto 确实存在个 channel 竞态可能导致崩溃,已经修复 测试 8.8.8.8 53 看完了个 20 分钟的 youtube 视频, |
|
Currently, the dns-query-domain-length in many DNS in Iran is restricted, some to 151 and some to 99, and returns server-failure or nxdomain for longer lengths. Currently, 90% of the 1% of people who are connected use dnstt/slipstream, But the number of remaining working DNSs is decreasing every day. Therefore, it is important that the domain length can be limited in XDNS. |
|
Also, XDNS should use base32 case insensitive encoding/decoding: Mygod/slipstream-rust#1 |
|
If I remember correctly, the domain name should be case-insensitive. You can control the domain name length by setting the MTU in the client. |
|
What is the minimum possible value of mtu? Why does the doc still say it is 576??? Because the data is converted to base32 and also a part is used for the main domain itself, to use restricted-Iran-dns, we need to lower mtu to about 50. |
tcp 包单元
delay: Int32Range 单位毫秒,为 0 会自动与前面合包
rand: int32 随机长度
type: packet type (array, str, hex, base64)
packet: []byte
tcp 对话序列: tcp 包单元 array
tcp header-custom settings
clients: tcp 对话序列 array,与 servers 遵循一发一收
servers: tcp 对话序列 array,与 clients 遵循一收一发
errors: tcp 对话序列 array,仅服务端,对于 clients 发来的验证不通过触发,无 clients 则不会触发
udp 包单元
rand: int32 随机长度
type: packet type (array, str, hex, base64)
packet: []byte
udp header-custom settings
client: udp 包单元 array,总是合并后加入每个 udp 包头,对于 rand 包单元则只验证长度
server: udp 包单元 array,总是合并后加入每个 udp 包头,对于 rand 包单元则只验证长度
from freedom
只修改配置的 interval 为 delay,其他与原来不变
from freedom
udp 包单元
rand: Int32Range 随机长度
type: packet type (array, str, hex, base64)
packet: []byte
delay: Int32Range 单位毫秒,发送一个 item 后延迟多少
noise settings
reset Int32Range 单位秒,对于同个连接周期已经发送过的 addr 进行 reset 后重新发送,默认 0 为全局同个 addr 只发送一次
noise: udp 包单元 array
修复 finalmask/udp dialer proxy
重构 finalmask/udp
xhttp h3 套上 finalmask/udp
伪装 ssh banner,对应
SSH-2.0-OpenSSH_10.0p2 Debian-7\r\n伪装 socks5 user pass 代理 example.com
对应 hex
伪装 smtp 587 starttls,一般搭配 raw + tls/reality
其他实现 tls 内层应该还会进行一次 smtp 验证,所以此 header 不防主动探测,
但骗下 DPI 还是没问题