diff --git a/cmd/agent/agent.go b/cmd/agent/agent.go index a02b9a0..102378a 100755 --- a/cmd/agent/agent.go +++ b/cmd/agent/agent.go @@ -10,8 +10,10 @@ import ( "io" "log" "net" + "net/url" "os" "os/exec" + "strings" "syscall" "time" "unsafe" @@ -194,5 +196,25 @@ func main() { }) //service = ConnectionServer(netCatServer) //service = ConnectionServer(echoServer) + log.Println() + log.Printf("Clients should use the following commands to connect to this agent:") + log.Println() + clientUrl := strings.ReplaceAll(wsURL, "/agent/", "/client/") + sshCommand := fmt.Sprintf("ssh -oServerAliveInterval=10 -oProxyCommand=\"wsproxy %s\" abc@localhost", + clientUrl) + sftpCommand := fmt.Sprintf("sftp -oServerAliveInterval=10 -oProxyCommand=\"wsproxy %s\" abc@localhost", + clientUrl) + log.Println(" # For SSH") + log.Println(" " + sshCommand) + log.Println() + log.Println(" # for SFTP") + log.Println(" " + sftpCommand) + log.Println() + urlObject, _ := url.Parse(wsURL) + + log.Printf("wsproxy can be downloaded from %s", + strings.ReplaceAll(urlObject.Scheme, "ws", "http")+ + "://"+urlObject.Host+"/docs/wsproxy") + log.Println() service.Run(listener) }