Skip to content

Commit

Permalink
Add more tunnel ssh loggging (#18286)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanp413 authored Jul 18, 2023
1 parent c747c1e commit 5b0541a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/supervisor/pkg/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1294,14 +1294,19 @@ func startAPIEndpoint(ctx context.Context, cfg *Config, wg *sync.WaitGroup, serv
return
}

log.Infof("tunnel ssh: Connected from %s", conn.RemoteAddr())

conn2, err := net.Dial("tcp", net.JoinHostPort("localhost", strconv.FormatInt(int64(cfg.SSHPort), 10)))
if err != nil {
log.WithError(err).Error("tunnel ssh: dial to ssh server failed")
return
}

go io.Copy(conn, conn2)
_, _ = io.Copy(conn2, conn)
_, err = io.Copy(conn2, conn)
if err != nil {
log.WithError(err).Error("tunnel ssh: error returned from io.copy")
}

conn.Close()
conn2.Close()
Expand Down

0 comments on commit 5b0541a

Please sign in to comment.