Repository: https://github.com/flamingo-stack/meshagent
Purpose: Cross-platform, high-performance remote management agent powering Flamingo / OpenFrame and MeshCentral-compatible infrastructures.
MeshAgent is a native C/C++ remote management agent that provides:
- Secure control channel to a management server
- Remote desktop (KVM) across Windows, Linux, and macOS
- WebRTC data channels
- Embedded JavaScript automation engine (Duktape)
- TLS/DTLS cryptography via OpenSSL
- High-performance asynchronous networking (Microstack)
- JPEG-based screen streaming
- Self-update and certificate-based authentication
It is architected as a modular, layered runtime composed of reusable subsystems.
The following diagram illustrates the full runtime architecture of MeshAgent:
flowchart TD
Server["Management Server"] --> TLS["TLS WebSocket Control Channel"]
TLS --> AgentCore["Meshcore Agent"]
subgraph Runtime["MeshAgent Runtime"]
AgentCore --> Microstack["Microstack Core"]
AgentCore --> ScriptEngine["Microscript (Duktape)"]
AgentCore --> KVM["Platform KVM Engine"]
AgentCore --> DataStore["SimpleDataStore"]
AgentCore --> Update["Self-Update Engine"]
end
Microstack --> WebRTC["WebRTC (ICE / DTLS / SCTP)"]
Microstack --> HTTP["HTTP / WebSocket"]
Microstack --> AsyncSockets["Async TCP / UDP"]
KVM --> JPEG["Jpeg Turbo Core"]
KVM --> OS["OS Graphics & Input APIs"]
AgentCore --> OpenSSL["OpenSSL Core"]
WebRTC --> OpenSSL
sequenceDiagram
participant Agent
participant Server
participant Browser
Agent->>Server: WebSocket Upgrade (TLS)
Server->>Agent: AuthRequest
Agent->>Server: AuthVerify (Cert + Signature)
Server->>Agent: AuthConfirm
Browser->>Server: Start Remote Desktop
Server->>Agent: KVM Command
Agent->>Agent: Capture Screen
Agent->>Agent: JPEG Compress Tiles
Agent->>Browser: Stream via WebRTC DataChannel
MeshAgent is composed of the following major modules:
Role: Orchestrator and runtime container.
- Control channel management
- Certificate authentication
- CoreModule JavaScript execution
- Remote desktop session routing
- Self-update mechanism
- Persistent configuration
📖 Documentation:
meshcore-agent
Key structure:
MeshAgentHostContainerMeshCommand_BinaryPacket_*SCRIPT_ENGINE_*RemoteDesktop_Ptrs
Role: Asynchronous networking and protocol stack.
- Non-blocking TCP/UDP sockets
- HTTP client/server
- WebSocket support
- WebRTC (ICE, STUN, DTLS, SCTP)
- Process pipes
- Data store
- Remote logging
- IP monitoring
📖 Documentation:
microstack-core
Core subsystems:
- Async Sockets
- Web Client and Server
- WebRTC
- Cryptography
- Data Store
- Remote Logging
- Process Pipe
Role: Embedded JavaScript runtime layer.
- Duktape engine
- Node.js-like stream APIs
- EventEmitter
- File system bindings
- WebRTC bindings
- Crypto bindings
- Script container isolation
📖 Documentation:
microscript-duk
Enables:
- CoreModule execution
- Secure remote automation
- Plugin-style scripting
Implements cross-platform remote desktop:
- GDI/DXGI capture
- Multi-monitor support
- Touch injection
- Secure desktop handling
📖 meshcore-kvm-windows
- X11 / XShm framebuffer capture
- Tile-based CRC diffing
- XTest input injection
📖 meshcore-kvm-linux
- LaunchAgent reverse-connection model
- CoreGraphics capture
- Code-signature IPC validation
- TCC permission handling
📖 meshcore-kvm-macos
Role: High-performance JPEG compression engine.
Used by:
- KVM tile compression
- Lossless transforms
- TurboJPEG fast buffer APIs
📖 jpeg-turbo-core
Compression pipeline:
flowchart LR
RGB["RGB Frame Buffer"] --> DCT["Forward DCT"]
DCT --> Quant["Quantization"]
Quant --> Huff["Huffman Encoding"]
Huff --> JPEG["JPEG Tile Output"]
Role: Cryptographic foundation (OpenSSL 1.1.1f).
- TLS / SSL
- X.509 certificates
- ASN.1 engine
- RSA / EC / DH
- Digest and MAC
- CMS / PKCS7 / PKCS12
📖 openssl-core
Role: OpenSSL 3.x header interface layer.
- Provider-based architecture
- EVP_KDF / EVP_MAC
- OSSL_PARAM
- Modernized crypto abstraction
📖 openssl-include
Reference implementations:
- C-based rendezvous server
- Native Microstack WebRTC console sample
- C# WinForms WebRTC wrapper
📖 samples-webrtc
Built on ILibChain reactor pattern — single-threaded, non-blocking core.
KVM engines isolated per OS.
- TLS everywhere
- Certificate pinning
- Code-signature validation (macOS)
- Secure desktop handling (Windows)
Each subsystem (JPEG, TLS, WebRTC, Scripting) can evolve independently.
- Tile-based differential encoding
- CRC change detection
- TurboJPEG acceleration
- Zero-copy async sockets
flowchart TD
MeshcoreAgent["Meshcore Agent"]
Microstack["Microstack Core"]
Microscript["Microscript Duk"]
KVM["Platform KVM"]
JPEG["Jpeg Turbo Core"]
OpenSSL["OpenSSL"]
MeshcoreAgent --> Microstack
MeshcoreAgent --> Microscript
MeshcoreAgent --> KVM
MeshcoreAgent --> OpenSSL
KVM --> JPEG
Microstack --> OpenSSL
Microscript --> Microstack
The meshagent repository implements a complete, production-grade remote management agent with:
- Secure TLS control channel
- WebRTC streaming
- Cross-platform remote desktop
- Embedded scripting runtime
- High-performance asynchronous networking
- Certificate-based authentication
- Self-updating capability
It combines:
meshcore-agent(runtime orchestrator)microstack-core(networking)microscript-duk(JavaScript engine)meshcore-kvm-*(remote desktop backends)jpeg-turbo-core(screen compression)openssl-core/openssl-include(cryptography)
Together, these modules form a highly modular, portable, and security-focused remote management system suitable for MSP platforms such as Flamingo / OpenFrame.
Repository:
https://github.com/flamingo-stack/meshagent