Local desktop app framework - web frontends connecting to gunicorn/nginx over Unix sockets (Linux/macOS) or named pipes (Windows).
Harbor enables building desktop applications where:
- Frontend: Servo-powered web view
- Backend: Any HTTP server (gunicorn, nginx, Flask, FastAPI, etc.)
- Transport: Unix Domain Sockets (Linux/macOS) or Named Pipes (Windows)
This architecture provides:
- Security: No network exposure - backend only accessible via local IPC
- Performance: Lower latency than TCP loopback
- Simplicity: Use familiar web technologies
# app.toml
[app]
name = "My App"
version = "1.0.0"
[backend]
command = "gunicorn"
args = ["--bind", "unix:/tmp/myapp.sock", "-w", "2", "app:create_app()"]
socket = "/tmp/myapp.sock"
[frontend]
url = "http::unix///tmp/myapp.sock/"
width = 1200
height = 800# app.py
from flask import Flask
def create_app():
app = Flask(__name__)
@app.route('/')
def index():
return '''
<html>
<head><title>My Harbor App</title></head>
<body>
<h1>Welcome to Harbor!</h1>
<p>Running on Unix socket</p>
</body>
</html>
'''
return app
if __name__ == '__main__':
app = create_app()
app.run()harbor app.toml| Field | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Application name |
version |
string | No | Version (default: "0.1.0") |
icon |
path | No | Application icon |
description |
string | No | Description |
| Field | Type | Required | Description |
|---|---|---|---|
command |
string | Yes | Command to start backend |
args |
array | No | Command arguments |
socket |
string | Yes | Socket path (Unix) or pipe name (Windows) |
workdir |
path | No | Working directory |
env |
table | No | Environment variables |
startup_timeout |
int | No | Seconds to wait (default: 30) |
restart_on_crash |
bool | No | Auto-restart (default: true) |
| Field | Type | Required | Description |
|---|---|---|---|
url |
string | Yes | Transport-aware URL |
width |
int | No | Window width (default: 1024) |
height |
int | No | Window height (default: 768) |
title |
string | No | Window title (default: app name) |
resizable |
bool | No | Allow resize (default: true) |
decorated |
bool | No | Show frame (default: true) |
fullscreen |
bool | No | Start fullscreen (default: false) |
| Field | Type | Required | Description |
|---|---|---|---|
devtools |
bool | No | Enable devtools (default: false) |
log_level |
string | No | Log level (default: "info") |
user_agent |
string | No | Custom user agent |
Harbor uses transport-aware URLs from the Rigging library:
http::unix///tmp/app.sock/ # Unix socket (absolute path)
http::unix//var/run/app.sock/ # Unix socket (relative path)
http::pipe//myapp/ # Windows named pipe
[backend]
command = "gunicorn"
args = ["--bind", "unix:/tmp/app.sock", "-w", "4", "app:app"]
socket = "/tmp/app.sock"[backend]
command = "uwsgi"
args = ["--socket", "/tmp/app.sock", "--wsgi-file", "app.py"]
socket = "/tmp/app.sock"[backend]
command = "nginx"
args = ["-c", "/path/to/nginx.conf"]
socket = "/tmp/app.sock"[backend]
command = "node"
args = ["server.js"]
socket = "/tmp/app.sock"
env = { SOCKET_PATH = "/tmp/app.sock" }┌─────────────────────────────────────────────────────────────┐
│ Harbor Application │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────────┐ ┌──────────────────────────┐ │
│ │ Frontend │ UDS │ Backend │ │
│ │ (Servo WebView) │◄───────►│ (gunicorn/nginx/etc) │ │
│ │ │ │ │ │
│ │ - HTML/CSS/JS │ │ - Flask/FastAPI/etc │ │
│ │ - User Input │ │ - Business Logic │ │
│ │ - Rendering │ │ - Data Processing │ │
│ └──────────────────┘ └──────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
Harbor's architecture provides inherent security:
- No Network Exposure: Backend only listens on Unix socket
- File Permissions: Socket has user-only access (0600)
- Process Isolation: Backend runs as child process
- No Ports: No TCP ports to scan or attack
| Feature | Harbor | Electron | Tauri |
|---|---|---|---|
| Engine | Servo | Chromium | WebView |
| Backend | Any HTTP server | Node.js | Rust |
| Bundle Size | ~20MB | ~150MB | ~3MB |
| Memory | Lower | Higher | Lower |
| Transport | UDS/Named Pipe | IPC | IPC |
| Frontend | Standard Web | Standard Web | Standard Web |
- Linux: Unix Domain Sockets ✅
- macOS: Unix Domain Sockets ✅
- Windows: Named Pipes (planned)
Mozilla Public License 2.0 (MPL-2.0)
Harbor uses Rigging for browser embedding and transport support. Rigging provides:
- Stable API for embedding the Servo browser engine
- Transport-aware URL parsing
- Unix socket and other transport support
See Rigging for more details.