Skip to main content

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

You should see:

Configuration

Basic Settings

Generate API Key

1

Auto-Generate

Returns:
2

Manual

Add to config:
3

Verify

Shows:

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

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:
Exceeding limit returns:

CORS Configuration

Remote Access with Tailscale

Do NOT expose the gateway directly to the internet. Use a private network like 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

Follow link to authenticate
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:
Directory structure:
Access at: 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:
Fix:

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