Share DeepSeek Harness Web UI: public-url and trusted-host
The first instinct after a local DeepSeek Harness quickstart is “send the address to a colleague.” The default Web UI listens on loopback, so another machine cannot reach it, and the printed URL carries a process credential. Real sharing splits into three jobs: the proxy owns the external link, --public-url announces, and --trusted-host admits (source).
DeepSeek Harness: Three boundaries: port, announcement, trust
Publishing is not “change the address”; it is three boundaries at once. The split (source):
| Boundary | Owned by | Job |
|---|---|---|
| Listening port | dsh process | Where requests enter |
| Announced address | --public-url | What the browser and user should see |
| Trusted authority | --trusted-host | Which browser Host values are accepted |
All three are required. An announced address alone does not let requests in; an open port alone may reject the Host; trust alone does not build the external link.
The most common mistake is configuring one. public-url alone gives the right-looking address but API 403. trusted-host alone lets requests in but the printed address remains loopback. An open port alone may connect but fail Host checks.
Keep the roles separate. public-url is not “open access,” and trusted-host is not “set a domain”; each solves one segment.
DeepSeek Harness: Why the printed URL is not shareable
The printed URL fails for two reasons: it is unreachable, and it carries a credential. dsh --profile web serves the GUI on a loopback port, so browsers on other machines cannot reach it, and the process does not know your external address (source).
The second reason is security: the URL contains a launch token and should be shared only with intended users. Posting it in a group shares the credential. The token exchanges for a session cookie, so possession means entry.
The correct share is not “copy the address.” It is “build a controlled external link and give colleagues an entry without the launch token.” A reverse proxy usually owns that link; configuration examples are in Reverse proxy and HTTPS for dsh web.
DeepSeek Harness: What public-url announces and does not protect
--public-url tells others what the address is; it does not let requests in or admit them. It accepts an http:// or https:// root with an optional mount prefix, normalizes it with a trailing slash, and supplies the printed startup URL, DSH_WEB_URL, and the runtime context URL (source).
The critical detail: the webserver still serves origin-root routes and never learns the mount. --public-url https://app.example/ui/ only announces the external address; internal routes still start at /. The proxy strips the mount prefix.
Two consequences:
- Match the proxy — if the proxy strips
/ui/to/, public-url should include/ui/. - Do not expect port protection — public-url is display, not a firewall.
For example, external users open https://app.example/ui/; the proxy turns /ui/api/... into /api/...; public-url should be https://app.example/ui/. A shorter public-url produces a printed address that 404s.
Announcement and protection are different. Treating public-url as a security switch is the common misread.
DeepSeek Harness: trusted-host: no flag, 403
--trusted-host decides which browser authority is accepted; without it, every API call may 403. The fence accepts loopback, the listener's own bind address, and each authority named by --trusted-host; any other authority gets 403 even with a perfect proxy (source).
Separate the two actions:
- public-url announces — display, not admission.
- trusted-host admits — decides the pass.
A public-url without trusted-host is the classic “address looks right, APIs all 403.” trusted-host without public-url may work but prints the wrong address, so copying it still fails.
For tunnels that bind a different port each time, a trusted-host entry without a port matches any port. That is useful for temporary sharing, not a license to trust any host.
trusted-host only admits; it does not authenticate. The launch token and signed session cookie authenticate. The fence decides the authority, not the user.
DeepSeek Harness: Four proxy requirements
A proxy must do four things right; missing one produces 403, a blank page, a dropped WebSocket, or a login loop (source):
- Preserve the browser-visible Host — the fence compares it with accepted authorities; do not rewrite it to the listener address.
- Strip the mount prefix — the listener serves origin-root routes, so
/ui/api/...must arrive as/api/.... - Forward upgrade requests — every request and WebSocket upgrade must carry
UpgradeandConnection. - Rewrite cookie scope — the backend issues a host-only
Path=/cookie; rewrite Path to the mount and addSecureon the HTTPS leg.
One more: /ui/ is the only entry. A bare /ui must redirect to /ui/; only /ui/ exchanges the launch token for a session cookie. Browsers that already hold the cookie can also use /ui/index.html.
These five cover most “the proxy works but the page does not” cases. Nginx and Caddy examples belong in the proxy article.
TLS can terminate at the proxy or at the listener. Either way, public-url remains an announcement; with listener TLS, the session cookie already has Secure, so the proxy only rewrites Path. Certificates identify the server, not the user.
DeepSeek Harness: Verify from another machine
Verify from another machine, not a new local tab. Local loopback always works and proves nothing about the external link. Five steps (source):
- Open the announced address elsewhere — the page loads instead of timing out.
- Check API 403 — page loads but APIs all 403 points at trusted-host.
- Check WebSocket upgrade — a frozen stream points at Upgrade headers.
- Check cookie scope — a login loop points at Path and Secure.
- Confirm the port is not exposed — keep it inside the proxy or private network.
All five pass before “colleagues can use it.” Passing only the first means the page loads but interaction may still be broken.
For a quick same-network share, an SSH tunnel may be enough; see DeepSeek Harness remote access. For long-term external access, use a reverse proxy and TLS. Startup and port details are in How to open dsh web.
Before sharing, ask whether you are sending an entry or a launch URL. The first needs proxy and auth configuration; the second hands over a process credential.
Announcement is not admission; trust is not authentication.
FAQ
DeepSeek Harness usually does not work that way. DeepSeek Harness listens on loopback by default, so another machine cannot reach it, and the printed URL carries the launch token. External access needs a proxy and the right flags.
public-url announces the browser-facing address but does not admit it; trusted-host decides which browser authorities the DeepSeek Harness fence accepts. Without trusted-host, APIs can return 403.
DeepSeek Harness supports that. The DeepSeek Harness fence compares the received Host with accepted authorities, so rewriting Host to the listener address causes rejection. Preserve the browser-visible Host.
DeepSeek Harness does not work that way. public-url and the fence do not protect the listening port itself. Keep the port inside a trusted proxy or network, and remember TLS protects only the browser-to-proxy leg.
Related Terms
- loopback
- Loopback is the local-only address range; the DeepSeek Harness Web UI listens there by default, so browsers on other machines cannot connect.— DeepSeek Harness docs - Publishing the Web UI
- public-url
- public-url is a DeepSeek Harness startup flag that announces the browser-facing address, normalized with a trailing slash, without making it reachable.— DeepSeek Harness docs - Publishing the Web UI
- trusted-host
- trusted-host is a DeepSeek Harness flag that admits browser-visible authorities; the fence allows loopback, the listener address, and named hosts.— DeepSeek Harness docs - Publishing the Web UI
- launch token
- A launch token is the process credential in the printed DeepSeek Harness URL; it exchanges for a session cookie and should not be shared casually.— DeepSeek Harness docs - Publishing the Web UI
Sources
- DeepSeek Harness docs - Publishing the Web UI behind a reverse proxy· deepseek-harness
- DeepSeek Harness reference - Web app· deepseek-ai