io

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client a hermes client

func NewClient

func NewClient(appPort int, remotePort int, remoteHost string, opts ...ClientOption) (*Client, error)

NewClient creates a client

func (*Client) Start

func (c *Client) Start() error

Start the client

type ClientAuthenticator

type ClientAuthenticator func(int) string

ClientAuthenticator generates a password for a connection

type ClientOption

type ClientOption func(*Client)

ClientOption applies client options

func WithLocalHost

func WithLocalHost(host string) ClientOption

WithLocalHost update the local IP to forward to

func WithPassword

func WithPassword(password string) ClientOption

WithPassword sets client password

func WithRestarts

func WithRestarts() ClientOption

WithRestarts will auto restart on failure

func WithServerAddress

func WithServerAddress(addr *net.TCPAddr) ClientOption

WithServerAddress sets a custom hermes address

func WithTLS

func WithTLS(addr *net.TCPAddr, tlsCfg *tls.Config) ClientOption

WithTLS sets up a TLS connection

type Server

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

Server a hermes server

func NewServer

func NewServer(metaPort int, opts ...ServerOption) (*Server, error)

NewServer creates a server

func (*Server) Start

func (srv *Server) Start() error

Start the server

type ServerAuthenticator

type ServerAuthenticator func(string, int, string) bool

ServerAuthenticator validates a client password

type ServerOption

type ServerOption func(*Server)

ServerOption applies server options

func WithServerPassword

func WithServerPassword(password string) ServerOption

WithServerPassword sets server password

func WithServerTLS

func WithServerTLS(port int, tlsCfg *tls.Config) ServerOption

WithServerTLS enables TLS

Jump to

Keyboard shortcuts

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