|
@@ -133,9 +133,13 @@ func (m *Manager) NewSSHProxy(binaryRoot string) (*Instance, error) {
|
|
|
}
|
|
|
|
|
|
//Create a new Connection to target address
|
|
|
-func (i *Instance) CreateNewConnection(listenPort int, remoteIpAddr string, remotePort int) error {
|
|
|
+func (i *Instance) CreateNewConnection(listenPort int, username string, remoteIpAddr string, remotePort int) error {
|
|
|
//Create a gotty instance
|
|
|
- cmd := exec.Command(i.ExecPath, "-w", "-p", strconv.Itoa(listenPort), "--once", "ssh", remoteIpAddr, "-p", strconv.Itoa(remotePort))
|
|
|
+ connAddr := remoteIpAddr
|
|
|
+ if username != "" {
|
|
|
+ connAddr = username + "@" + remoteIpAddr
|
|
|
+ }
|
|
|
+ cmd := exec.Command(i.ExecPath, "-w", "-p", strconv.Itoa(listenPort), "--once", "ssh", connAddr, "-p", strconv.Itoa(remotePort))
|
|
|
cmd.Stdout = os.Stdout
|
|
|
cmd.Stderr = os.Stderr
|
|
|
go func() {
|