vpn

package
v0.0.0-...-8293206 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Code_Error byte = iota
	Code_Success
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(serverconn net.Conn, remoteip string, remoteport int) *client

func SetErrorHandle

func SetErrorHandle(errhandle func(error))

func StartServer

func StartServer(listenaddr string, listenport int) error

Types

type Ack

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

func (*Ack) GetCode

func (a *Ack) GetCode() byte

func (*Ack) SetCode

func (a *Ack) SetCode(code byte)

type BasicRandomNumberGenerator

type BasicRandomNumberGenerator struct{}

func (*BasicRandomNumberGenerator) Init

func (brng *BasicRandomNumberGenerator) Init()

func (*BasicRandomNumberGenerator) Read

func (brng *BasicRandomNumberGenerator) Read(b []byte)

type CipherEnum

type CipherEnum = byte
const (
	CipherPlain CipherEnum = iota
	CipherAes256GCM
	CipherChaCha20poly1305
)

type Encryptor

type Encryptor interface {
	Key([]byte) Encryptor
	Encrypt(plaintext, dst []byte) ([]byte, error)
	Decrypt(ciphertext, dst []byte) ([]byte, error)
	NonceSize() int
}

func GetEncryptor

func GetEncryptor(enum CipherEnum, key []byte) Encryptor

type HelloMessage

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

func (*HelloMessage) GetBytes

func (hm *HelloMessage) GetBytes() []byte

func (*HelloMessage) GetMessage

func (hm *HelloMessage) GetMessage() string

func (*HelloMessage) SetBytes

func (hm *HelloMessage) SetBytes(b []byte)

func (*HelloMessage) SetMessage

func (hm *HelloMessage) SetMessage(s string)

type RandomNumberGenerator

type RandomNumberGenerator interface {
	Read([]byte)
}

type RemoteConnectionInfo

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

func (*RemoteConnectionInfo) GetInfo

func (info *RemoteConnectionInfo) GetInfo() (remoteip string, remoteport int)

func (*RemoteConnectionInfo) GetSize

func (info *RemoteConnectionInfo) GetSize() int

func (*RemoteConnectionInfo) SetInfo

func (info *RemoteConnectionInfo) SetInfo(remoteip string, remoteport int)

Jump to

Keyboard shortcuts

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