tunnel

package
v1.12.7 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleInbound

func HandleInbound(ctx context.Context, t Tunnel, conn net.Conn, port uint32) error

HandleInbound maintains a remote connection using the Tunnel interface. The `port` is the port "identifier", used to identify the remote target.

func HandleOutbound

func HandleOutbound(ctx context.Context, t Tunnel, tunnelID uint64, port uint32, buff *Buffer)

HandleOutbound creates a new outbound connection (TCP or HTTP) based on the Target matching the port "identifier".

Types

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

func NewBuffer

func NewBuffer() *Buffer

func (*Buffer) Close

func (b *Buffer) Close()

func (*Buffer) Put

func (b *Buffer) Put(ctx context.Context, data []byte) error

func (*Buffer) Take

func (b *Buffer) Take(ctx context.Context) ([]byte, error)

type Target

type Target struct {
	Host    string
	Options *platformv1.InterfaceOptions
}

type Tunnel

type Tunnel interface {
	Write(tunnelID uint64, data []byte) error
	Close(tunnelID uint64, err error)
	Target(tunnelID uint64, port uint32) (Target, error)
	NewTunnelID(port uint32) (uint64, *Buffer, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳