very bad demo code

This commit is contained in:
Joe Kralicky 2025-02-18 01:33:15 +00:00
parent b4aa275403
commit d588135b3a
No known key found for this signature in database
GPG key ID: 75C4875F34A9FB79
30 changed files with 1308 additions and 248 deletions

View file

@ -115,6 +115,7 @@ func GetDomainsForURL(u *url.URL, includeDefaultPort bool) []string {
// tcp+https://ssh.example.com:22
// udp+https://ssh.example.com:22
// ssh://ssh.example.com:22
// => ssh.example.com:22
// tcp+https://proxy.example.com/ssh.example.com:22
// udp+https://proxy.example.com/ssh.example.com:22
@ -130,10 +131,13 @@ func GetDomainsForURL(u *url.URL, includeDefaultPort bool) []string {
}
var defaultPort string
if u.Scheme == "http" {
switch u.Scheme {
case "http":
defaultPort = "80"
} else {
case "https":
defaultPort = "443"
case "ssh":
defaultPort = "22"
}
// for hosts like 'example.com:1234' we only return one route