Create Route
Create an HTTP proxy route for a VM. The route maps a subdomain (e.g.,myapp.hatch.local) to a specific port inside the VM.
Path Parameters
The VM ID to create a route for.
Request Body
The subdomain to use. Must be lowercase alphanumeric with optional hyphens, max 63 characters. If not provided, a random 12-character subdomain is generated.Reserved subdomains:
api, www, admin, app, dashboard, mail, smtp, ftp, ssh, ns1, ns2, status, docs, help, support, billing, login, auth, oauth, cdn, static, assets, media, hatch, console, panel, grafana, prometheus, traefik, minio, postgres, db, redis, internal.The port inside the VM to forward traffic to. Must be between 1 and 65535.
Whether to automatically wake the VM if it’s in a stopped or snapshotted state when a request arrives. Defaults to
true.Response
Unique route identifier (e.g.,
rt_abc123).The VM ID this route belongs to.
The subdomain for this route.
The target port inside the VM.
Whether auto-wake is enabled.
ISO 8601 timestamp when the route was created.
ISO 8601 timestamp when the route was last updated.
Example Request
Example Response
:9090 and base domain hatch.local)
List Routes for VM
Retrieve all proxy routes for a specific VM.Path Parameters
The VM ID.
Response
Returns an array of route objects, ordered by creation date (most recent first).Example Request
Example Response
Delete Route
Delete a proxy route by its ID.Path Parameters
The route ID to delete.
Response
Returns
deleted on success.Example Request
Example Response
Subdomain Validation
Rules
- Must be lowercase alphanumeric characters with optional hyphens
- Cannot start or end with a hyphen
- Maximum length: 63 characters
- Must match regex:
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$
Reserved Subdomains
The following subdomains are reserved and cannot be used:Invalid Subdomain Examples
Auto-Wake Feature
Whenauto_wake is enabled (default), the proxy server will automatically restore a VM from a stopped or snapshotted state when an HTTP request arrives for that route.
Configure the proxy server using:
HATCH_PROXY_ADDR- Proxy listen address (default::9090)HATCH_PROXY_BASE_DOMAIN- Base domain for routes (default:hatch.local)HATCH_PROXY_WAKE_TIMEOUT- Maximum time to wait for VM wake (default:60s)