tunnel

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApoxy4To6Prefix

func NewApoxy4To6Prefix(projectID uuid.UUID, endpoint string) netip.Prefix

NewApoxy4To6Prefix generates a new IPv6 address from the Apoxy4To6Range prefix.

Types

type IPAM added in v0.8.3

type IPAM interface {
	// Allocate allocates an IP address for a peer.
	Allocate(r *http.Request) netip.Prefix

	// Release releases an IP address for a peer. No-op if the address is not allocated
	// (returns nil).
	Release(peerPrefix netip.Prefix) error
}

func NewRandomULA added in v0.8.3

func NewRandomULA() IPAM

type TunnelClient added in v0.8.4

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

func NewTunnelClient added in v0.8.4

func NewTunnelClient(opts ...TunnelClientOption) (*TunnelClient, error)

NewTunnelClient creates a new SOCKS5 proxy and loopback reverse proxy, that forwards and receives traffic via QUIC tunnels.

func (*TunnelClient) LocalAddresses added in v0.8.4

func (c *TunnelClient) LocalAddresses() ([]netip.Prefix, error)

Get the local addresses assigned to the tunnel client.

func (*TunnelClient) Start added in v0.8.4

func (c *TunnelClient) Start(ctx context.Context) error

Start establishes a connection to the server and begins forwarding traffic.

func (*TunnelClient) Stop added in v0.8.4

func (t *TunnelClient) Stop() error

Stop closes the tunnel client and stops forwarding traffic.

type TunnelClientOption added in v0.8.4

type TunnelClientOption func(*tunnelClientOptions)

func WithAuthToken added in v0.8.4

func WithAuthToken(token string) TunnelClientOption

WithAuthToken sets the authentication token for the tunnel client.

func WithPcapPath added in v0.8.4

func WithPcapPath(path string) TunnelClientOption

WithPcapPath sets the optional path to a packet capture file for the tunnel client.

func WithRootCAs added in v0.8.4

func WithRootCAs(caCerts *x509.CertPool) TunnelClientOption

WithRootCAs sets the optional root CA certificates for TLS verification.

func WithServerAddr added in v0.8.4

func WithServerAddr(addr string) TunnelClientOption

WithServerAddr sets the server address that the tunnel client will connect to. The address should be in the format "host:port".

func WithSocksListenAddr added in v0.8.4

func WithSocksListenAddr(addr string) TunnelClientOption

WithSocksListenAddr sets the listen address for the local SOCKS5 proxy server.

func WithUUID added in v0.8.4

func WithUUID(uuid string) TunnelClientOption

WithUUID sets the UUID for the tunnel client.

type TunnelServer added in v0.8.3

type TunnelServer struct {
	http3.Server
	client.Client
	// contains filtered or unexported fields
}

func NewTunnelServer added in v0.8.3

func NewTunnelServer(opts ...TunnelServerOption) *TunnelServer

NewTunnelServer creates a new server proxy that routes traffic via QUIC tunnels.

func (*TunnelServer) AddTunnelNode added in v0.8.4

func (t *TunnelServer) AddTunnelNode(node *corev1alpha.TunnelNode)

AddTunnelNode adds a TunnelNode to the server. This is visible for testing purposes, it is usually called as part of the reconcile loop.

func (*TunnelServer) RemoveTunnelNode added in v0.8.4

func (t *TunnelServer) RemoveTunnelNode(node *corev1alpha.TunnelNode)

RemoveTunnelNode removes a TunnelNode from the server. This is visible for testing purposes, it is usually called as part of the reconcile loop.

func (*TunnelServer) SetupWithManager added in v0.8.4

func (t *TunnelServer) SetupWithManager(mgr ctrl.Manager) error

func (*TunnelServer) Start added in v0.8.3

func (t *TunnelServer) Start(ctx context.Context) error

func (*TunnelServer) Stop added in v0.8.3

func (t *TunnelServer) Stop() error

type TunnelServerOption added in v0.8.4

type TunnelServerOption func(*tunnelServerOptions)

func WithCertPath added in v0.8.3

func WithCertPath(path string) TunnelServerOption

WithCertPath sets the path to the TLS certificate.

func WithClient added in v0.8.4

func WithClient(client client.Client) TunnelServerOption

WithClient sets the kubernetes client to use.

func WithIPAM added in v0.8.3

func WithIPAM(ipam IPAM) TunnelServerOption

WithIPAM sets the IPAM to use.

func WithKeyPath added in v0.8.3

func WithKeyPath(path string) TunnelServerOption

WithKeyPath sets the path to the TLS key.

func WithLocalAddr added in v0.8.3

func WithLocalAddr(prefix netip.Prefix) TunnelServerOption

WithLocalAddr sets the local address prefix.

func WithProxyAddr added in v0.8.3

func WithProxyAddr(addr string) TunnelServerOption

WithProxyAddr sets the address to bind the proxy to.

func WithTUNName added in v0.8.3

func WithTUNName(name string) TunnelServerOption

WithTUNName sets the name of the TUN interface.

func WithULAPrefix added in v0.8.3

func WithULAPrefix(prefix netip.Prefix) TunnelServerOption

WithULAPrefix sets the Unique Local Address prefix.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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