Documentation
¶
Index ¶
- Constants
- func Dial(addr net.Addr, targetAddr common.Address, uuid string) (net.Conn, error)
- func Listen(addr net.Addr, publishAddr SignedETHAddr) (net.Conn, error)
- func NewServer(cfg ServerConfig, options ...Option) (*server, error)
- type ClusterConfig
- type Config
- type ConnID
- type MonitorConfig
- type Option
- type ServerConfig
- type SignedETHAddr
Constants ¶
const ( ErrInvalidHandshake int32 = iota ErrUnknownPeerType ErrTimeout )
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
Dial communicates with the relay server waiting for other server peer to establish a relayed TCP connection.
All network traffic will be transported through that server.
func Listen ¶
Listen publishes itself to the relay server waiting for other client peer to establish a relayed TCP connection.
All network traffic will be transported through that server.
func NewServer ¶
func NewServer(cfg ServerConfig, options ...Option) (*server, error)
NewServer constructs a new relay server using specified config with options.
Types ¶
type ClusterConfig ¶
type ClusterConfig struct { Name string Endpoint string Announce string SecretKey string `yaml:"secret_key" json:"-"` Members []string }
ClusterConfig represents a cluster membership config.
type Config ¶
Config represents a client-side relay configuration.
Used as a basic building block for high-level configurations.
type MonitorConfig ¶
type MonitorConfig struct { Endpoint string PrivateKey *ecdsa.PrivateKey `json:"-"` }
type Option ¶
type Option func(options *options) error
Option is a function that configures the server.
func WithLogger ¶
WithLogger is an option that specifies provided logger used for the internal logging. Nil value is supported and can be passed to deactivate the logging system entirely.
type ServerConfig ¶
type ServerConfig struct { Addr netutil.TCPAddr Cluster ClusterConfig Logging logging.Config Monitor MonitorConfig }
ServerConfig describes the complete relay server configuration.
func NewServerConfig ¶
func NewServerConfig(path string) (*ServerConfig, error)
NewServerConfig loads a new Relay server config from a file.
type SignedETHAddr ¶
type SignedETHAddr struct {
// contains filtered or unexported fields
}
SignedETHAddr represents self-signed ETH address.
func NewSignedAddr ¶
func NewSignedAddr(key *ecdsa.PrivateKey) (SignedETHAddr, error)
NewSignedAddr constructs a new self-signed Ethereum address using the specified private key.