(host, service string, port uint, useTLS bool)
| 6 | ) |
| 7 | |
| 8 | func URL(host, service string, port uint, useTLS bool) string { |
| 9 | if useTLS && port == 443 { |
| 10 | return fmt.Sprintf("https://%s.%s.local.nhost.run", host, service) |
| 11 | } else if !useTLS && port == 80 { |
| 12 | return fmt.Sprintf("http://%s.%s.local.nhost.run", host, service) |
| 13 | } |
| 14 | |
| 15 | protocol := schemeHTTP |
| 16 | if useTLS { |
| 17 | protocol = schemeHTTPS |
| 18 | } |
| 19 | |
| 20 | return fmt.Sprintf("%s://%s.%s.local.nhost.run:%d", protocol, host, service, port) |
| 21 | } |
| 22 | |
| 23 | // WebsocketURL returns the ws(s):// variant of URL(host, service, port, useTLS). |
| 24 | func WebsocketURL(host, service string, port uint, useTLS bool) string { |
no outgoing calls
no test coverage detected