Fixed a bug in the console command, where the CLI couldn't connect to Hub as when

the `url.URL` method was used, the Host included a path
This commit is contained in:
Alon Girmonsky 2024-09-27 12:34:42 -07:00
parent fc0ec5a840
commit e800d67e27

View File

@ -55,8 +55,8 @@ func runConsole() {
log.Info().Str("host", config.Config.Tap.Proxy.Host).Str("url", hubUrl).Msg("Connecting to:")
u := url.URL{
Scheme: "ws",
Host: fmt.Sprintf("%s:%d/api", config.Config.Tap.Proxy.Host, config.Config.Tap.Proxy.Front.Port),
Path: "/scripts/logs",
Host: fmt.Sprintf("%s:%d", config.Config.Tap.Proxy.Host, config.Config.Tap.Proxy.Front.Port),
Path: "/api/scripts/logs",
}
headers := http.Header{}
headers.Set(utils.X_KUBESHARK_CAPTURE_HEADER_KEY, utils.X_KUBESHARK_CAPTURE_HEADER_IGNORE_VALUE)