cmdchat

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

README

cmdchat

A basic WebSockets-based client / server / controller remote command & control tool

NOTE: This repository is work in progress

Documentation

Index

Constants

View Source
const (

	// DefaultMaxMessageSize denotes the default maximum size allowed for transmission (32 MiB)
	DefaultMaxMessageSize = 30 << 20

	// DefaultWriteTimeout denotes the default timeout for a write operation
	DefaultWriteTimeout = 10 * time.Second

	// DefaultKeepAliveInterval denotes the default interval for keepalive pings
	DefaultKeepAliveInterval = 30 * time.Second

	// DefaultKeepAliveDeadline denotes the default deadline for keepalive pings
	DefaultKeepAliveDeadline = 60 * time.Second
)

Variables

View Source
var (

	// DefaultAEADChipherTemplate denotes the default exnryption cipher template used for AEAD
	DefaultAEADChipherTemplate = aead.XChaCha20Poly1305KeyTemplate
)

Functions

func PrepareBasicAuthHeader

func PrepareBasicAuthHeader(user string) (string, error)

PrepareBasicAuthHeader asks for a user password and creates a ready-to use Basic Auth Authorization header content / value

func PrepareClientCertificateAuth

func PrepareClientCertificateAuth(certFile, keyFile, caFile string) (*tls.Config, error)

PrepareClientCertificateAuth reads the provided client certificate / key and CA certificate files (and potentially inteactively unlocks an encrypted key files)

Types

type Hub

type Hub struct {
	ReadChan  chan string
	WriteChan chan string
	// contains filtered or unexported fields
}

Hub denotes a connection hub / WebSocket interface

func New

func New(uri, keyPath string, tlsConfig *tls.Config, generateIfNotExists bool) (*Hub, error)

New initializes a new hub

func (*Hub) Close

func (h *Hub) Close() error

Close closes a hub

func (*Hub) Read

func (h *Hub) Read()

Read performs read operations on the WebSocket connection

func (*Hub) Write

func (h *Hub) Write()

Write performs write operations on the WebSocket connection

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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