Starbridge

package module
v3.0.17 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPrivateKey added in v3.0.4

func CheckPrivateKey(privKey crypto.PrivateKey) (success bool)

func CheckPublicKey added in v3.0.4

func CheckPublicKey(pubkey crypto.PublicKey) (keyError error)

func GenerateConfigFiles added in v3.0.8

func GenerateConfigFiles(address string, bindAddress *string) error

func GenerateKeys added in v3.0.8

func GenerateKeys() (publicKeyString, privateKeyString *string, keyError error)

func GenerateNewConfigPair added in v3.0.8

func GenerateNewConfigPair(address string, bindAddress *string) (*ServerConfig, *ClientConfig, error)

func NewClientConnection

func NewClientConnection(config replicant.ClientConfig, conn net.Conn) (net.Conn, error)

func NewReplicantClientConnectionState

func NewReplicantClientConnectionState(config replicant.ClientConfig) (*replicant.ConnectionState, error)

func NewReplicantServerConnectionState

func NewReplicantServerConnectionState(config replicant.ServerConfig, polishServer polish.Server, conn net.Conn) (*replicant.ConnectionState, error)

func NewServerConnection

func NewServerConnection(config replicant.ServerConfig, conn net.Conn) (net.Conn, error)

func ResolveAddr added in v3.0.10

func ResolveAddr(addrStr string) (*net.TCPAddr, error)

Resolve an address string into a net.TCPAddr. We are a bit more strict than net.ResolveTCPAddr; we don't allow an empty host or port, and the host part must be a literal IP address.

Types

type ClientConfig

type ClientConfig struct {
	ServerAddress   string `json:"serverAddress"`
	ServerPublicKey string `json:"serverPublicKey"`
	Transport       string `json:"transport"`
}

func (ClientConfig) Dial

func (config ClientConfig) Dial() (net.Conn, error)

Dial connects to the address on the named network

type ServerConfig

type ServerConfig struct {
	ServerAddress    string  `json:"serverAddress"`
	ServerPrivateKey string  `json:"serverPrivateKey"`
	Transport        string  `json:"transport"`
	BindAddress      *string `json:"bindAddress"`
}

func (ServerConfig) Listen

func (config ServerConfig) Listen() (net.Listener, error)

Listen checks for a working connection

type TransportClient

type TransportClient struct {
	Config  ClientConfig
	Address string
	// TODO: Dialer can be removed later (both here and in dispatcher)
	Dialer proxy.Dialer
}

func NewClient

func NewClient(config ClientConfig, dialer proxy.Dialer) TransportClient

func (*TransportClient) Dial

func (transport *TransportClient) Dial() (net.Conn, error)

Dial creates outgoing transport connection

type TransportServer

type TransportServer struct {
	Config  ServerConfig
	Address string
	// TODO: Dialer can be removed later (both here and in dispatcher)
	Dialer proxy.Dialer
}

func NewServer

func NewServer(config ServerConfig, address string, dialer proxy.Dialer) TransportServer

func (*TransportServer) Listen

func (transport *TransportServer) Listen() (net.Listener, error)

Jump to

Keyboard shortcuts

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