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

@ -18,7 +18,7 @@ import (
"nhooyr.io/websocket"
"cdr.dev/slog"
"github.com/coder/coder/agent"
"github.com/coder/coder/agent/agentssh"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/coderd/tracing"
@ -575,7 +575,7 @@ func (s *Server) workspaceAgentPTY(rw http.ResponseWriter, r *http.Request) {
return
}
defer ptNetConn.Close()
agent.Bicopy(ctx, wsNetConn, ptNetConn)
agentssh.Bicopy(ctx, wsNetConn, ptNetConn)
}
// wsNetConn wraps net.Conn created by websocket.NetConn(). Cancel func