MCPcopy Create free account
hub / github.com/Hidden-Node/GooseRelayVPN-AndroidClient / normalizeRelayURL

Function normalizeRelayURL

internal/config/client.go:172–188  ·  view source on GitHub ↗
(v string)

Source from the content-addressed store, hash-verified

170}
171
172func normalizeRelayURL(v string) (string, error) {
173 v = strings.TrimSpace(v)
174 if v == "" {
175 return "", nil
176 }
177 u, err := url.Parse(v)
178 if err != nil {
179 return "", fmt.Errorf("invalid relay_urls value %q: %w", v, err)
180 }
181 if u.Scheme != "http" && u.Scheme != "https" {
182 return "", fmt.Errorf("invalid relay_urls value %q: scheme must be http or https", v)
183 }
184 if strings.TrimSpace(u.Host) == "" {
185 return "", fmt.Errorf("invalid relay_urls value %q: host is required", v)
186 }
187 return u.String(), nil
188}
189
190// scriptKeyEntry is the parsed result of one script_keys array element. The
191// JSON form is either a plain string (legacy / unlabeled) or an object with

Callers 1

LoadClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected