feat: fix proxy compatibility and establish TUI foundation
This commit is contained in:
@@ -30,7 +30,7 @@ func newRunner() *fakeRunner {
|
||||
return &fakeRunner{schemas: []string{"org.gnome.system.proxy", "org.gnome.system.proxy.http", "org.gnome.system.proxy.https", "org.gnome.system.proxy.socks"}, values: map[string]string{
|
||||
"org.gnome.system.proxy mode": "'none'",
|
||||
"org.gnome.system.proxy autoconfig-url": "''",
|
||||
"org.gnome.system.proxy ignore-hosts": "[]",
|
||||
"org.gnome.system.proxy ignore-hosts": "@as []",
|
||||
"org.gnome.system.proxy.http host": "''", "org.gnome.system.proxy.http port": "0",
|
||||
"org.gnome.system.proxy.http use-authentication": "false", "org.gnome.system.proxy.http authentication-user": "''", "org.gnome.system.proxy.http authentication-password": "''",
|
||||
"org.gnome.system.proxy.https host": "''", "org.gnome.system.proxy.https port": "0",
|
||||
@@ -439,6 +439,28 @@ func TestSingleSOCKSProxyUsesGNOMESOCKSForAllProtocols(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDualProtocolEndpointConfiguresHTTPAndSOCKSAtSameAddress(t *testing.T) {
|
||||
r, s := newRunner(), &memoryState{}
|
||||
p := &profile.Profile{
|
||||
Name: "dual", Mode: profile.AdvancedMode,
|
||||
HTTPURL: "http://localhost:7890", HTTPSURL: "http://localhost:7890", AllURL: "socks5://localhost:7890",
|
||||
}
|
||||
got := adapter(r, s).SetDesired(context.Background(), true, p)
|
||||
if got.Err != nil || got.Inspection.State != target.Enabled {
|
||||
t.Fatalf("dual-protocol result = %#v", got)
|
||||
}
|
||||
for _, key := range []string{"org.gnome.system.proxy.http host", "org.gnome.system.proxy.https host", "org.gnome.system.proxy.socks host"} {
|
||||
if r.values[key] != "'localhost'" {
|
||||
t.Errorf("%s = %q", key, r.values[key])
|
||||
}
|
||||
}
|
||||
for _, key := range []string{"org.gnome.system.proxy.http port", "org.gnome.system.proxy.https port", "org.gnome.system.proxy.socks port"} {
|
||||
if r.values[key] != "7890" {
|
||||
t.Errorf("%s = %q", key, r.values[key])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestAdvancedHTTPProxyCredentialsArePreserved(t *testing.T) {
|
||||
r, s := newRunner(), &memoryState{}
|
||||
p := *active()
|
||||
|
||||
Reference in New Issue
Block a user