Architecture
The web server provides:- HTTP REST API for session management and control
- WebSocket API for real-time session updates
- Mobile-optimized UI for on-the-go access
- Security token authentication for secure remote access
Configuration
Enable the web server from Maestro’s settings:Configure Port (Optional)
By default, Maestro uses a random available port. You can specify a custom port:
- Enable Use Custom Port
- Set Custom Port (default: 8080)
URL Structure
All endpoints require a security token that’s automatically generated when the server starts.The security token is regenerated each time Maestro restarts. Bookmark the full URL including the token.
REST API Endpoints
Get All Sessions
Retrieve all active sessions.Get Session Details
Retrieve detailed information for a specific session, including conversation logs.Get Theme
Retrieve the current theme configuration.Send Command
Execute a command in a session.Interrupt Session
Stop the currently running command in a session.WebSocket API
Connect to the WebSocket endpoint for real-time updates.Connection
Message Types
Message type identifier
init- Initial connection datasession:state- Session state changesession:added- New session createdsession:removed- Session deletedsession:live- Session marked as livesession:offline- Session marked as offlinetabs:change- Tab configuration changedtheme:change- Theme updated
Client Messages
Send commands to Maestro via WebSocket:Rate Limiting
The web server includes configurable rate limiting to prevent abuse:Maximum requests per minute for GET endpoints
Maximum requests per minute for POST endpoints
Time window in milliseconds (default: 1 minute)
Security
Auto-generated Tokens
Security tokens are UUIDs regenerated on each app restart
Invalid Token Handling
Requests with invalid/missing tokens redirect to the Maestro website
Local Network Only
Server binds to 0.0.0.0 but is designed for local network access only
No Persistent Authentication
No user accounts or persistent auth - access is token-based only
For secure public internet access, use the Tunnel Manager to create a Cloudflare tunnel.
Implementation Details
The web server is built with:- Fastify - High-performance HTTP framework
- @fastify/websocket - WebSocket support
- @fastify/cors - CORS handling
- @fastify/rate-limit - Rate limiting
src/main/web-server/WebServer.ts:1