Skip to content
Permalink
Browse files

Add console URL to connection output

  • Loading branch information
antoniomika committed Dec 25, 2019
1 parent 5027801 commit 839a7317d417629451e71c734fa3d36219c49d9f
Showing with 16 additions and 1 deletion.
  1. +16 −1 requests.go
@@ -146,7 +146,22 @@ func handleRemoteForward(newRequest *ssh.Request, sshConn *SSHConnection, state
defer state.Console.RemoveRoute(host)

if *serviceConsoleEnabled && sendToken {
requestMessages += fmt.Sprintf("Service console can be accessed with token: %s\r\n", routeToken)
scheme := "http"
portString := ""
if httpPort != 80 {
portString = fmt.Sprintf(":%d", httpPort)
}

if *httpsEnabled {
scheme = "https"
if httpsPort != 443 {
portString = fmt.Sprintf(":%d", httpsPort)
}
}

consoleURL := fmt.Sprintf("%s://%s%s", scheme, host, portString)

requestMessages += fmt.Sprintf("Service console can be accessed here: %s/_sish/console?x-authorization=%s\r\n", consoleURL, routeToken)
}
}

0 comments on commit 839a731

Please sign in to comment.
You can’t perform that action at this time.