refactor(agent): Move SSH server into agentssh package (#7004)

Refs: #6177
This commit is contained in:
Mathias Fredriksson
2023-04-06 19:39:22 +03:00
committed by GitHub
parent 3ff2ae1b1a
commit 0224426e5b
9 changed files with 908 additions and 548 deletions

View File

@ -14,7 +14,7 @@ import (
"github.com/pion/udp"
"golang.org/x/xerrors"
"github.com/coder/coder/agent"
"github.com/coder/coder/agent/agentssh"
"github.com/coder/coder/cli/clibase"
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/codersdk"
@ -226,7 +226,7 @@ func listenAndPortForward(ctx context.Context, inv *clibase.Invocation, conn *co
}
defer remoteConn.Close()
agent.Bicopy(ctx, netConn, remoteConn)
agentssh.Bicopy(ctx, netConn, remoteConn)
}(netConn)
}
}(spec)

View File

@ -23,7 +23,7 @@ import (
"golang.org/x/term"
"golang.org/x/xerrors"
"github.com/coder/coder/agent"
"github.com/coder/coder/agent/agentssh"
"github.com/coder/coder/cli/clibase"
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/coderd/autobuild/notify"
@ -574,7 +574,7 @@ func sshForwardRemote(ctx context.Context, stderr io.Writer, sshClient *gossh.Cl
}
}
agent.Bicopy(ctx, localConn, remoteConn)
agentssh.Bicopy(ctx, localConn, remoteConn)
}()
}
}()