(tls bool, httpIP string, port int)
| 99 | } |
| 100 | |
| 101 | func formatURL(tls bool, httpIP string, port int) string { |
| 102 | proto := "http" |
| 103 | if tls { |
| 104 | proto = "https" |
| 105 | } |
| 106 | host := httpIP |
| 107 | if httpIP == "0.0.0.0" || httpIP == "127.0.0.1" { |
| 108 | host = "devd.io" |
| 109 | } |
| 110 | if port == 443 && tls { |
| 111 | return fmt.Sprintf("https://%s", host) |
| 112 | } |
| 113 | if port == 80 && !tls { |
| 114 | return fmt.Sprintf("http://%s", host) |
| 115 | } |
| 116 | return fmt.Sprintf("%s://%s:%d", proto, host, port) |
| 117 | } |
| 118 | |
| 119 | // Credentials is a simple username/password pair |
| 120 | type Credentials struct { |
no outgoing calls