Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions core/internal/profile/vless_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,18 @@ func TestPickWithVLESS(t *testing.T) {
t.Fatalf("Others in a vless round = %#v", others)
}
}

// The subscription names "ios" and "edge" among the hellos; both pass through as given, for REALITY and for TLS.
func TestParseVLESSKeepsIOSAndEdgeFingerprints(t *testing.T) {
for _, fp := range []string{"ios", "edge"} {
for name, base := range map[string]map[string]any{"reality": realityVision(), "tls": tlsWS()} {
p, err := ParseVLESS(vlessSettings(t, base, map[string]any{"fingerprint": fp}))
if err != nil {
t.Fatalf("%s %s: %v", name, fp, err)
}
if p.Fingerprint != fp {
t.Errorf("%s %s = %q", name, fp, p.Fingerprint)
}
}
}
}
21 changes: 21 additions & 0 deletions core/internal/xray/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,24 @@ func TestStreamConfigXMux(t *testing.T) {
t.Errorf("concurrency and connections 0 = %v", x)
}
}

// "ios" and "edge" reach Xray's config unchanged for REALITY and for TLS, and Xray knows both as uTLS presets.
func TestStreamConfigKeepsIOSAndEdgeFingerprints(t *testing.T) {
for _, fp := range []string{"ios", "edge"} {
if tls.GetFingerprint(fp) == nil {
t.Fatalf("Xray has no preset %q", fp)
}
p := sample("reality", "raw")
p.Fingerprint = fp
security, _ := streamOf(t, p).SecuritySettings[0].GetInstance()
if got := security.(*reality.Config).Fingerprint; got != fp {
t.Errorf("reality %s = %q", fp, got)
}
p = sample("tls", "ws")
p.Fingerprint = fp
security, _ = streamOf(t, p).SecuritySettings[0].GetInstance()
if got := security.(*tls.Config).Fingerprint; got != fp {
t.Errorf("tls %s = %q", fp, got)
}
}
}
Loading