jailoc 2.11: open workspace web apps over HTTPS
Release 2.11
When your agent starts a web app inside a jailoc workspace, you can open it in your usual browser without moving the app out of the VM. The jailoc 2.11 workspace proxy gives each configured app its own local HTTPS hostname.
Set up the host with jailoc proxy install. It shows what it will change before asking for confirmation and uses sudo for the privileged steps. Starting a workspace alone doesn't change your host's name resolution, trust stores or firewall.
From a guest port to a browser tab
Say the app runs on port 3000 inside the demo workspace. Give it a route name in your jailoc configuration:
[workspaces.demo]
paths = ["~/projects/demo"]
[workspaces.demo.proxy]
web = 3000
jailoc proxy install
jailoc up demo
Once the app is running in the VM, open https://web.demo.jailoc.local (or http://web.demo.jailoc.local, which redirects to HTTPS with 307 while keeping path and query) in your host browser. There's no port to type. The name web picks a guest port; demo picks the workspace. The host listener is loopback-only, so this doesn't publish the app on your LAN. Routes don't require a login code by default; use web = { port = 3000, auth = true } to require one, or https_redirect = false (per route, per workspace, or in [defaults.proxy]) to turn off the HTTP redirect.
What the installer changes
Three things have to line up for that URL to work:
- The name resolves locally. jailoc writes the configured workspace and route names into a managed block in
/etc/hosts, leaving unrelated entries alone. Runjailoc proxy installagain after adding or renaming routes to sync the names.jailoc reloadapplies route changes to a running workspace; it doesn't edit/etc/hosts. - Something listens on ports 80 and 443. A root-owned listener broker runs as a LaunchDaemon on macOS or a systemd service on Linux. It listens only on IPv4 and IPv6 loopback (on
http_portandhttps_port, 80 and 443 by default) and hands connections to your unprivileged jailoc proxy over a private socket. The broker doesn't handle TLS or parse HTTP. That separation is why you don't need a firewall redirect or to run the proxy itself as root. - The client trusts the certificate. jailoc installs its local CA in your macOS login keychain or a supported Linux system trust store, and in supported browser NSS databases when
certutilis available. The CA and its intermediate are name-constrained tojailoc.local; this is still a change to your host's trust settings. On Linux, a successfulcurldoesn't mean Firefox or Chromium trusts the CA. If the browser still warns, check the browser trust setup.
This is traffic from the host browser into a configured guest service, not a change to the network rules that govern where your agent can connect from the VM.
Custom ports and running without a system service
If ports 80 and 443 are taken—or you don't want a persistent root service—set unprivileged ports in the top-level [proxy] table:
[proxy]
http_port = 8080
https_port = 8081
With high ports, jailoc proxy binds them directly as your user (no jailoc proxy install, no sudo, and no port forwards), and URLs carry the port (https://web.demo.jailoc.local:8081). Pass jailoc proxy --foreground if you don't want a background process either—Ctrl+C stops it cleanly. Browsers still need /etc/hosts and CA trust, while curl --cacert ... --resolve ... works without touching any host setting. If you do use the listener broker with custom ports, re-run jailoc proxy install after changing them so the service picks up the new ports.
Check the proxy without checking the app
The bare workspace URL gives you a way to tell whether you're debugging the proxy or your app:
jailoc proxy status
curl https://demo.jailoc.local/
jailoc proxy status checks the background proxy, broker reachability, CA trust and missing host entries. The bare URL returns 200 OK with the body OK without contacting a guest service. If that works but https://web.demo.jailoc.local doesn't, check the app and its configured guest port next.
Undo the host setup
If you stop using the automated setup, jailoc proxy uninstall asks for confirmation, then removes the listener service, the managed hosts entries and the trust changes it made. The proxy routes guide covers browser-specific setup, troubleshooting and the manual alternative.