sshproxy

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PP_SID            = "pp-sid/"
	PP_PRIVATE_KEY    = PP_SID + "privateKey"
	ATTESTATION       = "Attestation"
	KUBERNETES        = "Kubernetes"
	KUBERNETES_PHASE  = "KUBERNETES_PHASE"
	ATTESTATION_PHASE = "ATTESTATION_PHASE"
	BOTH_PHASES       = "BOTH_PHASES"
	PHASE             = "Phase"
	UPGRADE           = "Upgrade"
)

Variables

This section is empty.

Functions

func NewInboundInstance

func NewInboundInstance(tcpConn io.ReadWriteCloser, peer *SshPeer, inbound *Inbound)

func ParseTag

func ParseTag(tag string) (port int, host, name, phase string, err error)

ParseTag() parses an inbound or outbound tag Outbound tags with structure <Phase>:<Name>:<Port>

are interperted to approach 127.0.0.1:<Port>

Outbound tags with structure <Phase>:<Name>:<Host>:<Port>

are interperted to approach <Host>:<Port>

Inbound tags with structure <Phase>:<Name>:<Port>

are interperted to serve 127.0.0.1:<Port> on host network namespace

Inbound tags with structure <Phase>:<Name>:<Namespace>:<Port>

are interperted to serve 127.0.0.1:<Port> on <Namespace> network namepsace

Types

type Inbound

type Inbound struct {
	// tcp peers
	Name        string
	TcpListener *net.TCPListener
	Connections chan *net.Conn
	Phase       string // ATTESTATION_PHASE, KUBERNETES_PHASE, BOTH_PHASES
}

Inbound side of the Tunnel - incoming tcp connections from local clients

type Inbounds

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

func (*Inbounds) Add

func (inbounds *Inbounds) Add(namespace string, inPort int, name, phase string, wg *sync.WaitGroup) (string, error)

func (*Inbounds) AddTags

func (inbounds *Inbounds) AddTags(tags []string, inboundPorts map[string]string, wg *sync.WaitGroup) error

func (*Inbounds) DelAll

func (inbounds *Inbounds) DelAll()

NewInbound create an Inbound and listen to incoming client connections

type Outbound

type Outbound struct {
	// tcp peers
	Name    string
	OutAddr string
	Phase   string // ATTESTATION_PHASE, KUBERNETES_PHASE, BOTH_PHASES
}

type Outbounds

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

func (*Outbounds) Add

func (outbounds *Outbounds) Add(port int, host, name, phase string)

func (*Outbounds) AddTags

func (outbounds *Outbounds) AddTags(tags []string) error

type SID

type SID string

type SshPeer

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

func NewSshPeer

func NewSshPeer(ctx context.Context, phase string, sshConn ssh.Conn, chans <-chan ssh.NewChannel, sshReqs <-chan *ssh.Request, sid string) *SshPeer

NewSshPeer

func (*SshPeer) AddInbound

func (peer *SshPeer) AddInbound(inbound *Inbound)

NewInbound create an Inbound and listen to incoming client connections

func (*SshPeer) AddInbounds

func (peer *SshPeer) AddInbounds(inbounds Inbounds)

NewOutbound create an outbound and connect to an outgoing server

func (*SshPeer) AddOutbound

func (peer *SshPeer) AddOutbound(outbound *Outbound)

NewOutbound create an outbound and connect to an outgoing server

func (*SshPeer) AddOutbounds

func (peer *SshPeer) AddOutbounds(outbounds Outbounds)

NewOutbound create an outbound and connect to an outgoing server

func (*SshPeer) AddTags

func (peer *SshPeer) AddTags(inbounds Inbounds, outbounds Outbounds)

func (*SshPeer) Close

func (peer *SshPeer) Close(who string)

func (*SshPeer) IsUpgraded

func (peer *SshPeer) IsUpgraded() bool

func (*SshPeer) Ready

func (peer *SshPeer) Ready()

func (*SshPeer) Upgrade

func (peer *SshPeer) Upgrade()

func (*SshPeer) Wait

func (peer *SshPeer) Wait()

Jump to

Keyboard shortcuts

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