mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-24 13:36:24 +00:00
feat(finalmask): sync transport with upstream Xray core changes
Consolidate the eight legacy mKCP/header UDP mask types into a single mkcp-legacy type ({header, value}), simplify xicmp to {dgram, ips}, and add the new realm UDP mask type, matching the updated Xray-core wire format. Update the FinalMask schema enum, the transport form, the mKCP seeding default, and the backend KCP share-link translation. Refresh golden fixtures/snapshots and add backend coverage for the mapping.
This commit is contained in:
@@ -665,6 +665,46 @@ func TestExtractKcpShareFields_ReadsAllFields(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestExtractKcpShareFields_FinalMaskLegacyHeader(t *testing.T) {
|
||||
stream := map[string]any{
|
||||
"finalmask": map[string]any{
|
||||
"udp": []any{
|
||||
map[string]any{
|
||||
"type": "mkcp-legacy",
|
||||
"settings": map[string]any{"header": "wechat", "value": ""},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
got := extractKcpShareFields(stream)
|
||||
if got.headerType != "wechat-video" {
|
||||
t.Fatalf("headerType = %q, want wechat-video", got.headerType)
|
||||
}
|
||||
if got.seed != "" {
|
||||
t.Fatalf("seed = %q, want empty for header mask", got.seed)
|
||||
}
|
||||
}
|
||||
|
||||
func TestExtractKcpShareFields_FinalMaskLegacySeed(t *testing.T) {
|
||||
stream := map[string]any{
|
||||
"finalmask": map[string]any{
|
||||
"udp": []any{
|
||||
map[string]any{
|
||||
"type": "mkcp-legacy",
|
||||
"settings": map[string]any{"header": "", "value": "obfs-pass"},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
got := extractKcpShareFields(stream)
|
||||
if got.headerType != "none" {
|
||||
t.Fatalf("headerType = %q, want none for empty-header legacy mask", got.headerType)
|
||||
}
|
||||
if got.seed != "obfs-pass" {
|
||||
t.Fatalf("seed = %q, want obfs-pass", got.seed)
|
||||
}
|
||||
}
|
||||
|
||||
func TestKcpShareFields_ApplyToParams(t *testing.T) {
|
||||
params := map[string]string{}
|
||||
kcpShareFields{headerType: "wechat-video", seed: "s", mtu: 1350, tti: 50}.applyToParams(params)
|
||||
|
||||
Reference in New Issue
Block a user