commandconn

package
v23.0.2+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package commandconn provides a net.Conn implementation that can be used for proxying (or emulating) stream via a custom command.

For example, to provide an http.Client that can connect to a Docker daemon running in a Docker container ("DIND"):

httpClient := &http.Client{
	Transport: &http.Transport{
		DialContext: func(ctx context.Context, _network, _addr string) (net.Conn, error) {
			return commandconn.New(ctx, "docker", "exec", "-it", containerID, "docker", "system", "dial-stdio")
		},
	},
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, cmd string, args ...string) (net.Conn, error)

New returns net.Conn

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL