client

package
v0.7.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoActiveDestinations = errors.New("no active destinations")
View Source
var ErrNoDialedDestinations = errors.New("no dialed destinations")

Functions

This section is empty.

Types

type Destination

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

func NewDestination

func NewDestination(cfg DestinationConfig, direct *DirectServer, root *certc.Cert, logger *slog.Logger) (*Destination, error)

func (*Destination) Accept added in v0.6.0

func (d *Destination) Accept() (net.Conn, error)

func (*Destination) AcceptContext added in v0.7.0

func (d *Destination) AcceptContext(ctx context.Context) (net.Conn, error)

func (*Destination) Config added in v0.7.0

func (d *Destination) Config() DestinationConfig

func (*Destination) PeerStatus added in v0.7.0

func (d *Destination) PeerStatus() (PeerStatus, error)

func (*Destination) RunAnnounce added in v0.7.0

func (d *Destination) RunAnnounce(ctx context.Context, conn quic.Connection, directAddrs []netip.AddrPort, notifyResponse func(error)) error

func (*Destination) RunPeer added in v0.7.0

func (d *Destination) RunPeer(ctx context.Context) error

type DestinationConfig added in v0.5.0

type DestinationConfig struct {
	Forward          model.Forward
	Route            model.RouteOption
	Proxy            model.ProxyVersion
	RelayEncryptions []model.EncryptionScheme
}

DestinationConfig structure represents destination configuration.

func NewDestinationConfig added in v0.5.0

func NewDestinationConfig(name string) DestinationConfig

NewDestinationConfig creates a destination config for a given name

func (DestinationConfig) WithProxy added in v0.5.0

WithProxy sets the proxy version option for this configuration.

func (DestinationConfig) WithRelayEncryptions added in v0.6.0

func (cfg DestinationConfig) WithRelayEncryptions(schemes ...model.EncryptionScheme) DestinationConfig

WithRelayEncryptions sets the relay encryptions option for this configuration.

func (DestinationConfig) WithRoute added in v0.5.0

WithRoute sets the route option for this configuration.

type DirectServer

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

func NewDirectServer

func NewDirectServer(transport *quic.Transport, logger *slog.Logger) (*DirectServer, error)

func (*DirectServer) Run

func (s *DirectServer) Run(ctx context.Context) error

type PeerConnection added in v0.4.0

type PeerConnection struct {
	ID    string `json:"id"`
	Style string `json:"style"`
	Addr  string `json:"addr"`
}

type PeerStatus added in v0.4.0

type PeerStatus struct {
	Relays      []string         `json:"relays"`
	Connections []PeerConnection `json:"connections"`
}

type Source

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

func NewSource

func NewSource(cfg SourceConfig, direct *DirectServer, root *certc.Cert, logger *slog.Logger) (*Source, error)

func (*Source) Config added in v0.7.0

func (s *Source) Config() SourceConfig

func (*Source) Dial added in v0.6.0

func (s *Source) Dial(network, address string) (net.Conn, error)

func (*Source) DialContext added in v0.6.0

func (s *Source) DialContext(ctx context.Context, network, address string) (net.Conn, error)

func (*Source) PeerStatus added in v0.7.0

func (s *Source) PeerStatus() (PeerStatus, error)

func (*Source) RunAnnounce added in v0.7.0

func (s *Source) RunAnnounce(ctx context.Context, conn quic.Connection, directAddrs []netip.AddrPort, notifyResponse func(error)) error

func (*Source) RunPeer added in v0.7.0

func (s *Source) RunPeer(ctx context.Context) error

type SourceConfig added in v0.5.0

type SourceConfig struct {
	Forward          model.Forward
	Route            model.RouteOption
	RelayEncryptions []model.EncryptionScheme
}

SourceConfig structure represents source configuration.

func NewSourceConfig added in v0.5.0

func NewSourceConfig(name string) SourceConfig

NewSourceConfig creates a source config for a given name.

func (SourceConfig) WithRelayEncryptions added in v0.6.0

func (cfg SourceConfig) WithRelayEncryptions(schemes ...model.EncryptionScheme) SourceConfig

WithRelayEncryptions sets the relay encryptions option for this configuration.

func (SourceConfig) WithRoute added in v0.5.0

func (cfg SourceConfig) WithRoute(route model.RouteOption) SourceConfig

WithRoute sets the route option for this configuration.

Jump to

Keyboard shortcuts

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