Quellcode durchsuchen

auto update script executed

Toby Chui vor 1 Jahr
Ursprung
Commit
a668fbf217
1 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  1. 5 1
      mod/sshprox/sshprox.go

+ 5 - 1
mod/sshprox/sshprox.go

@@ -140,7 +140,11 @@ func (i *Instance) CreateNewConnection(listenPort int, username string, remoteIp
 		connAddr = username + "@" + remoteIpAddr
 	}
 	configPath := filepath.Join(filepath.Dir(i.ExecPath), ".gotty")
-	cmd := exec.Command(i.ExecPath, "-w", "-p", strconv.Itoa(listenPort), "--once", "--config", configPath, "ssh", connAddr, "-p", strconv.Itoa(remotePort))
+	title := username + "@" + remoteIpAddr
+	if remotePort != 22 {
+		title = title + ":" + strconv.Itoa(remotePort)
+	}
+	cmd := exec.Command(i.ExecPath, "-w", "-p", strconv.Itoa(listenPort), "--once", "--config", configPath, "--title-format", title, "ssh", connAddr, "-p", strconv.Itoa(remotePort))
 	cmd.Dir = filepath.Dir(i.ExecPath)
 	cmd.Stdout = os.Stdout
 	cmd.Stderr = os.Stderr