proxy

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunProxy

func RunProxy(ctx context.Context, rw http.ResponseWriter, req *http.Request, destination *url.URL) apierror.APIErrors

Types

type ForwardedPort

type ForwardedPort struct {
	Local  uint16
	Remote uint16
}

func ParsePorts

func ParsePorts(ports []string) ([]ForwardedPort, error)

valid port specifications:

5000 - forwards from localhost:5000 to pod:5000

8888:5000 - forwards from localhost:8888 to pod:5000

0:5000 :5000

  • selects a random available local port, forwards from localhost:<random port> to pod:5000

type ListenAddress

type ListenAddress struct {
	Address     string
	Protocol    string
	FailureMode string
}

func ParseAddresses

func ParseAddresses(addressesToParse []string) ([]ListenAddress, error)

type TCPProxy

type TCPProxy struct {
	Logger       logr.Logger
	DialTimeout  time.Duration
	Address      string
	IncomingConn net.Conn
	OutgoingConn net.Conn
}

func NewTCPProxy

func NewTCPProxy(ctx context.Context, IncomingConn net.Conn, address string) (*TCPProxy, error)

func (*TCPProxy) Start

func (p *TCPProxy) Start() error

Jump to

Keyboard shortcuts

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