client

package
v0.0.0-...-b393aa8 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HKDFInfoClientToServerAESGCMSIV string = "HKDF_INFO_CLIENT_TO_SERVER_AES_GCM_SIV"
	HKDFInfoServerToClientAESGCMSIV string = "HKDF_INFO_SERVER_TO_CLIENT_AES_GCM_SIV"
)

HKDF related

View Source
const (
	AESGCMSIVKeyLenAsBytes int = 32
)

AES related

View Source
const (
	ClientSideSessionSaltLen int = 16
)

Salt config

View Source
const (
	KeyRotationInterval uint64 = 1 << 31 // = 2^31
)

Key rotation

Variables

View Source
var (
	ErrInvalidPaddingLengthConfig    error = errors.New("invalid padding length config")
	ErrUnexpectedNoiseIKCipherStates error = errors.New("unexpected Noise IK cipher states")
	ErrEmptyNoiseResponse            error = errors.New("empty noise response")
	ErrTAPNotClosedProperlyBefore    error = errors.New("TAP not closed properly before")
)

Errors

Functions

func SerializedTAPReader

func SerializedTAPReader(ctx context.Context, tap *water.Interface, wg *sync.WaitGroup) (<-chan []byte, <-chan error)

func SerializedTAPWriter

func SerializedTAPWriter(ctx context.Context, tap *water.Interface, wg *sync.WaitGroup) (chan<- []byte, <-chan error)

Although it has a "closed chan check", you should not close the Chan manually.

Just use context and let GC do the extra works.

func SerializedWSSReader

func SerializedWSSReader(ctx context.Context, conn *websocket.Conn, wg *sync.WaitGroup) (<-chan []byte, <-chan error)

func SerializedWSSWriter

func SerializedWSSWriter(ctx context.Context, conn *websocket.Conn, wg *sync.WaitGroup) (chan<- []byte, <-chan error)

Althought it has a "closed chan check", you should not close the Chan manually.

Just use context and let GC do the extra works.

Types

type RoxyClient

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

Struct RoxyClient is the struct of Roxy Client

Instance DB is a SQLite database contains everything needs, like config.

Logs are logged to this DB too, so it's easy to move everything to another machine without any pain.

You don't need to close any chan manually.

func NewRoxyClient

func NewRoxyClient(instanceDB string) (*RoxyClient, error)

Create a new roxy client instance from a specified instance DB.

func (*RoxyClient) Connect

func (client *RoxyClient) Connect() error

TODO: Use Noise IK message to auth. TODO: Support pluggable auth. FIXME: Remove Bearer Auth Related.

func (*RoxyClient) Disconnect

func (client *RoxyClient) Disconnect() error

func (*RoxyClient) IfaceName

func (client *RoxyClient) IfaceName() string

Get TAP name.

func (*RoxyClient) LogToAll

func (client *RoxyClient) LogToAll(level shared.LogLevel, msg string)

func (*RoxyClient) LogToDatabase

func (client *RoxyClient) LogToDatabase(level shared.LogLevel, msg string)

func (*RoxyClient) LogToScreen

func (client *RoxyClient) LogToScreen(level shared.LogLevel, msg string)

func (*RoxyClient) Shutdown

func (client *RoxyClient) Shutdown() error

After Shutdown, the related object should be DROPPED, do NOT reuse it!

func (*RoxyClient) Watchdog

func (client *RoxyClient) Watchdog()

Do NOT start watchdog with client.linkWorkersWG.Go()!

Jump to

Keyboard shortcuts

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