Documentation
¶
Overview ¶
Package tunnel provides the functions used by the CLI to tunnel into a container using either a tunneled connection from the workspace client (using a machine provider) or a direct SSH connection from the proxy client (Ssh, k8s or docker provider)
Index ¶
- func CreateSSHCommand(ctx context.Context, client client2.BaseWorkspaceClient, logger log.Logger, ...) (*exec.Cmd, error)
- func NewTunnel(ctx context.Context, tunnel Tunnel, handler Handler) error
- func RunServices(ctx context.Context, opts RunServicesOptions) error
- func SetupBackhaul(ctx context.Context, client client2.BaseWorkspaceClient, authSockID string, ...) error
- func StartBrowserTunnel(p BrowserTunnelParams) error
- type BrowserTunnelParams
- type ContainerTunnel
- type Handler
- type RunServicesOptions
- type Tunnel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSSHCommand ¶ added in v0.20.1
func CreateSSHCommand( ctx context.Context, client client2.BaseWorkspaceClient, logger log.Logger, extraArgs []string, ) (*exec.Cmd, error)
CreateSSHCommand builds an exec.Cmd that runs `devpod ssh` with the given arguments.
func NewTunnel ¶
NewTunnel creates a tunnel to the devcontainer using generic functions to establish the "outer" and "inner" tunnel, used by proxy clients Here the tunnel will be an SSH connection with it's STDIO as arguments and the handler will be the function to execute the command using the connected SSH client.
func RunServices ¶
func RunServices(ctx context.Context, opts RunServicesOptions) error
RunServices forwards the ports for a given workspace and uses its SSH client to run the credentials server remotely and the services server locally to communicate with the container.
func SetupBackhaul ¶ added in v0.20.1
func SetupBackhaul( ctx context.Context, client client2.BaseWorkspaceClient, authSockID string, logger log.Logger, ) error
SetupBackhaul sets up a long-running SSH connection for backhaul.
func StartBrowserTunnel ¶ added in v0.20.1
func StartBrowserTunnel(p BrowserTunnelParams) error
StartBrowserTunnel sets up a browser tunnel for IDE access, either via daemon or SSH.
Types ¶
type BrowserTunnelParams ¶ added in v0.20.1
type BrowserTunnelParams struct {
Ctx context.Context
DevPodConfig *config.Config
Client client2.BaseWorkspaceClient
User string
TargetURL string
ForwardPorts bool
ExtraPorts []string
AuthSockID string
GitSSHSigningKey string
Logger log.Logger
// DaemonStartFunc is called when the client is a DaemonClient.
// If nil, the SSH tunnel path is always used.
DaemonStartFunc func(ctx context.Context) error
}
BrowserTunnelParams bundles the arguments for browser-based IDE tunnels.
type ContainerTunnel ¶
type ContainerTunnel struct {
// contains filtered or unexported fields
}
ContainerTunnel manages the state of the tunnel to the container.
func NewContainerTunnel ¶
func NewContainerTunnel(client client.WorkspaceClient, log log.Logger) *ContainerTunnel
NewContainerTunnel constructs a ContainerTunnel using the workspace client, if proxy is True then the workspace's agent config is not periodically updated.
type RunServicesOptions ¶ added in v0.12.1
type RunServicesOptions struct {
DevPodConfig *config.Config
ContainerClient *ssh.Client
User string
ForwardPorts bool
ExtraPorts []string
PlatformOptions *devpod.PlatformOptions
Workspace *provider.Workspace
ConfigureDockerCredentials bool
ConfigureGitCredentials bool
ConfigureGitSSHSignatureHelper bool
GitSSHSigningKey string
Log log.Logger
}
RunServicesOptions contains all options for running services.