UDP noises: Add base64 and multi-packet support#3794
Conversation
|
看起来换成了 SplitN 按照惯例,noise 改名 noises 以支持数组,noise 留下报错(参考 fallback->fallbacks) |
本来就是故意同时支持数组和非数组避免break change的 这样不是白搞了 |
|
我觉得现在这样就挺好的 单个noise就一个结构体 不用写数组 更简洁不用套一层中括号 也兼容上版本的写法 |
|
I also like this form more, but if the convention in xray is to have separate pluralized keys, I think it is more important to follow it. |
Ok I will change it to noises |
|
If |
infra/conf/freedom.go
Outdated
| } | ||
| if c.Noise != nil { | ||
| for _, n := range c.Noise { | ||
| return nil, errors.New(`Freedom settings: please use "noises":[{}] instead of "noise":{}`) |
There was a problem hiding this comment.
In order to maintain backwards compat, I suggest to append to config.Noises instead. The behavior when both are defined can be an error, I think.
infra/conf/freedom.go
Outdated
| NConfig, err := ParseNoise(n) | ||
| if err != nil { | ||
| return nil, err | ||
| return nil, errors.New(err) |
There was a problem hiding this comment.
why is this wrapping necessary?
|
What do you think about a new option to merge current packet with next one? And a option to set multiple packets, and select one of them randomly
For direct connections(no cdn & no webserver), it is possible to hardcode fake packets in server and make it ignore the known fake packets, in this way it is possible to make noise to work with TCP too, when client sends known fake packets, must ignore it and continue the connections, fake packets + random data of vmess/ss+tcp for sure will bypass firewall |
If we want to this to work for any tcp based protocol,it needs to be implemented in transport layer,not in freedom which is way outside the scope of this pr |
|
不喜欢搞那么多语法糖, 干脆彻底不兼容,参考 #3812 (comment) ,分成 type 和 value,别 SplitN 了,只要 noises,配置 noise 就报错 |
@mmmray 有空改一下吗,不过能不能叫 type 我不确定 |
|
确实该分 写文档的时候就觉得这写法老奇怪了 |
|
我稍微改一下吧 这应该很简单 |
|
|
@Fangliding 把 type 移到最上面 |
|
@mmmray 可以帮忙改一下吗, |
|
not sure I understood, here you go (I feel that providing an example of the new syntax is nice-to-have in the error msg) |
|
|
@Fangliding Freedom 标题改为 noises |
|
刚好有一些小修改 顺便加进去就好了 |
XTLS#3794 (comment) --------- Co-authored-by: 风扇滑翔翼 <[email protected]> Co-authored-by: mmmray <[email protected]>
XTLS#3794 (comment) --------- Co-authored-by: 风扇滑翔翼 <[email protected]> Co-authored-by: mmmray <[email protected]>
XTLS#3794 (comment) --------- Co-authored-by: 风扇滑翔翼 <[email protected]> Co-authored-by: mmmray <[email protected]>
XTLS#3794 (comment) --------- Co-authored-by: 风扇滑翔翼 <[email protected]> Co-authored-by: mmmray <[email protected]>

This was per request of maintainers(mostly RPRX)
usage:
{ "protocol": "freedom", "settings": { "noise":[ { "packet":"base64:7nQBAAABAAAAAAAABnQtcmluZwZtc2VkZ2UDbmV0AAABAAE=", "delay":"5-10" }, { "packet":"rand:10-20", "delay":"10-20" } ] }, "tag": "direct" }the use of array is optional(to avoid a breaking change)
some cleanup is happened: used int32Range for delay instead of string,moved the config parsing part of noise to another function
now u can send as many noise packets as u want,the code will loop through and send all of them
u can add a base64 encoded string ,copy it straight from wireshark and boom
Note:if u want to use this with h3,do not send a quic client hello as noise,it will confuse the server and respond to that packet instead of intended one