Skip to content

Commit

Permalink
feat: print https endpoint when starting client
Browse files Browse the repository at this point in the history
  • Loading branch information
chetan committed Oct 28, 2021
1 parent b054cf0 commit 12c9ef5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ func startClientBinding(addr string, bind string, cmd *exec.Cmd, wg *sync.WaitGr
data := url.Values{}
data.Add("binding", bind)

fmt.Println("[*] registering vhost:", bind)
s := strings.Split(bind, ":")
if len(s) >= 2 {
fmt.Printf("[*] registering vhost: %s -> https://%s\n", bind, s[0])
} else {
fmt.Println("[*] registering vhost:", bind)
}
res, err := http.DefaultClient.PostForm(uri, data)
if err != nil {
stopCommand(cmd)
Expand All @@ -69,7 +74,11 @@ func startClientBinding(addr string, bind string, cmd *exec.Cmd, wg *sync.WaitGr
fmt.Println("exiting")
os.Exit(0)
}
log.Print(line)
if strings.HasPrefix(line, "[*] ") {
fmt.Print(line)
} else {
log.Print(line)
}
}
}

Expand Down

0 comments on commit 12c9ef5

Please sign in to comment.