Overview
The OrcBot Web Gateway provides:- REST API for remote control and management
- WebSocket for real-time events and bidirectional communication
- Dashboard hosting for web-based interfaces
- Secure authentication with API keys
Quick Start
Start the Gateway
Configuration
Basic Settings
Generate API Key
1
Auto-Generate
2
Manual
3
Verify
REST API
Authentication
Include API key in requests:API Endpoints
Status & Info
Tasks & Queue
Chat Interface
Memory
Configuration
Skills & Tools
Models & Providers
Security
Logs
WebSocket API
Connect to WebSocket
WebSocket Events
- status
- event
- chat
Agent status updates:
WebSocket Actions
Send commands via WebSocket:Security
API Key Authentication
The gateway uses timing-safe comparison for API keys:Security Headers
Automatically applied to all responses:Rate Limiting
Per-IP rate limiting:CORS Configuration
- Development
- Production
Remote Access with Tailscale
Why Tailscale?
- Private mesh network (WireGuard-based)
- No port forwarding needed
- Zero-trust access control
- End-to-end encryption
- Works across NAT/firewalls
Setup
1
Install Tailscale
2
Connect to Tailnet
3
Configure Gateway
4
Access Remotely
5
Set Up ACLs (Optional)
In Tailscale admin console, restrict access:
Hosting a Dashboard
Static File Serving
Serve a web dashboard:http://localhost:3100/
API available at: http://localhost:3100/api/*
Example Dashboard Code
Troubleshooting
Gateway Won’t Start
1
Check Port
2
Check Logs
3
Verify Config
API Key Not Working
CORS Errors
In browser console:WebSocket Disconnects
Best Practices
Security
- Always set a strong
gatewayApiKey - Use Tailscale or VPN for remote access
- Restrict CORS origins in production
- Enable rate limiting
- Monitor logs for suspicious activity
Performance
- Use WebSocket for real-time updates
- Cache static assets with CDN
- Set reasonable rate limits
- Monitor memory usage with
/api/health
Reliability
- Implement WebSocket reconnection logic
- Handle rate limit errors gracefully
- Use request IDs for debugging
- Monitor uptime and errors