feat: fix proxy compatibility and establish TUI foundation

This commit is contained in:
proxyctl coordinator
2026-07-17 20:30:52 +08:00
parent 0f4c122eff
commit daeb788eac
34 changed files with 1521 additions and 176 deletions
+28
View File
@@ -395,6 +395,34 @@ func TestProtocolProbeOnlyTriggersOnSingleURLField(t *testing.T) {
}
}
func TestProtocolProbeDetectsDualProtocolEndpointBuildsCompatibleAdvancedProfile(t *testing.T) {
module := &recordingModule{}
model := NewModel(module)
model.detect = func(_ context.Context, address string) (probe.Capabilities, error) {
return probe.Capabilities{HTTP: true, SOCKS5: true}, nil
}
model = updateKey(model, "p")
model = updateKey(model, "n")
model = updateRunes(model, "home")
model = updateKey(model, "tab")
model = updateRunes(model, "localhost:7890")
model, cmd := pressCtrlD(model)
if cmd == nil {
t.Fatal("ctrl+d did not start a Protocol Probe")
}
updated, _ := model.Update(cmd())
model = updated.(Model)
got := model.form.profile
if got.Mode != profile.AdvancedMode || got.HTTPURL != "http://localhost:7890" || got.HTTPSURL != "http://localhost:7890" || got.AllURL != "socks5://localhost:7890" {
t.Fatalf("dual-protocol Profile = %#v", got)
}
if view := model.View(); !strings.Contains(view, "Protocol Probe: detected HTTP and SOCKS5 proxy at localhost:7890") {
t.Fatalf("form view missing dual-protocol detection status:\n%s", view)
}
}
func TestProtocolProbeDetectsSOCKS5AndRewritesSingleURL(t *testing.T) {
module := &recordingModule{}
model := NewModel(module)