replicant

package module
v3.0.23 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 11 Imported by: 3

Documentation

Overview

Package replicant provides a PT 2.1 Go API implementation of the Replicant adversary-tunable transport

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientConnection

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

func NewServerConnection

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

func ResolveAddr added in v3.0.9

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"`
	Toneburst     toneburst.Config    `json:"toneburst"`
	Polish        polish.ClientConfig `json:"polish"`
	Transport     string              `json:"transport"`
}

func UnmarshalClientConfig added in v3.0.11

func UnmarshalClientConfig(data []byte) (*ClientConfig, error)

func (ClientConfig) Dial

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

Create outgoing transport connection

func (ClientConfig) Marshal

func (config ClientConfig) Marshal() (string, error)

func (ClientConfig) ToJsonString added in v3.0.9

func (config ClientConfig) ToJsonString() (string, error)

type ClientJsonConfig added in v3.0.11

type ClientJsonConfig struct {
	ServerAddress string                         `json:"serverAddress"`
	Toneburst     toneburst.StarburstConfig      `json:"toneburst"`
	Polish        DarkStarPolishClientJsonConfig `json:"polish"`
	Transport     string                         `json:"transport"`
}

type ConnectionState

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

func NewReplicantClientConnectionState

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

func NewReplicantServerConnectionState

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

type DarkStarPolishClientJsonConfig added in v3.0.11

type DarkStarPolishClientJsonConfig struct {
	ServerAddress   string `json:"serverAddress"`
	ServerPublicKey string `json:"serverPublicKey"`
}

type DarkStarPolishServerJsonConfig added in v3.0.11

type DarkStarPolishServerJsonConfig struct {
	ServerAddress    string `json:"serverAddress"`
	ServerPrivateKey string `json:"serverPrivateKey"`
}

type ServerConfig

type ServerConfig struct {
	ServerAddress string              `json:"serverAddress"`
	Toneburst     toneburst.Config    `json:"toneburst"`
	Polish        polish.ServerConfig `json:"polish"`
	Transport     string              `json:"transport"`
	BindAddress   *string             `json:"bindAddress"`
}

func UnmarshalServerConfig added in v3.0.11

func UnmarshalServerConfig(data []byte) (*ServerConfig, error)

func (ServerConfig) Listen

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

Create listener for incoming transport connection

func (ServerConfig) Marshal

func (config ServerConfig) Marshal() (string, error)

func (ServerConfig) ToJsonString added in v3.0.9

func (config ServerConfig) ToJsonString() (string, error)

type ServerJsonConfig added in v3.0.11

type ServerJsonConfig struct {
	ServerAddress string                         `json:"serverAddress"`
	Toneburst     toneburst.StarburstConfig      `json:"toneburst"`
	Polish        DarkStarPolishServerJsonConfig `json:"polish"`
	Transport     string                         `json:"transport"`
	BindAddress   *string                        `json:"bindAddress"`
}

type TransportClient

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

This makes Replicant compliant with Optimizer

func NewClient

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

func (TransportClient) Dial

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

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, dialer proxy.Dialer) TransportServer

func (TransportServer) Listen

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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