TUN-4811: Publish quick tunnels' hostname in /metrics under userHostname for backwards-compatibility

This commit is contained in:
Nuno Diegues
2021-07-28 09:27:05 +01:00
parent 67a3be5b7a
commit 0924549efd
3 changed files with 33 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"strings"
"time"
"github.com/google/uuid"
@@ -51,9 +52,14 @@ func RunQuickTunnel(sc *subcommandContext) error {
TunnelName: data.Result.Name,
}
url := data.Result.Hostname
if !strings.HasPrefix(url, "https://") {
url = "https://" + url
}
for _, line := range connection.AsciiBox([]string{
"Your Quick Tunnel has been created! Visit it at:",
data.Result.Hostname,
url,
}, 2) {
sc.log.Info().Msg(line)
}