https://box-<id>.tesser.review/ (other ports at
box-<id>--<port>.tesser.review) after signing in to Tesser. A share
gateway puts shared boxes on your own domain instead, such as
https://box-<id>.share.example.com/, for people with no Tesser account: a
designer, a client, a phone. Cloudflare Access decides who can open them.
The gateway is a Cloudflare Worker in your own Cloudflare account. Boxes
connect out to it, so nothing reaches into the network they run in, and the
Worker holds no secret.
What viewers get
tesser share <box>prints the gateway address next to the review link. The first declared port is atbox-<id>.<host>, every other port atbox-<id>--<port>.<host>.- Opening a sleeping box in a browser wakes it and shows progress. Only a person opening the page wakes it: curl or a script gets a 503 saying the box is asleep, and a page loaded without someone clicking or typing the address shows a Wake it button. Traffic keeps the box awake.
tesser share <box> --revoke, or the share expiring, takes the box off within a few seconds.- On
tesser.review, only the org’s active members can open a box. The first visit signs them in at tesser.sh, and the sign-in lasts 12 hours on that address.tesser gateway setmoves the org’s boxes offtesser.reviewonto your domain.
Pick the host
Boxes hang off one host,<host>, and each box takes one label in front of
it. Cloudflare’s free certificate covers a zone’s apex and one level below
it, so:
- A zone used only for the gateway, such as
examplereview.com, gives boxesbox-<id>.examplereview.comwith the free certificate. - A host one level down in your main zone, such as
share.example.com, puts boxes two levels deep. Their certificate needs Advanced Certificate Manager with Total TLS on the zone.
Set it up
You need a Cloudflare zone for<host> and Zero
Trust on the same account
(the free plan covers 50 users).
-
Point
<host>and*.<host>at Cloudflare with two proxied DNS records. The address does not matter; the Worker answers every request: -
In Zero Trust, add a self-hosted Access application on
*.<host>with the policies that say who may open shared boxes, such as your company’s email domain. Leave<host>itself outside it: boxes dial in there, and the Worker checks their tickets. Copy the application’s audience tag. -
Deploy the Worker from a project of its own:
index.tswrangler.jsonc
-
Point the org at it. Only an org admin can:
https://<host>/__tesser/health answers ok once the Worker is live. Share
a box with tesser share <box> and open the gateway address it prints.
How it works
- Boxes dial out. While a box is shared, Tesser hands it a ticket it
signs for your gateway, and the box keeps one websocket open to
wss://<host>/__tesser/box. The Worker checks the ticket againsthttps://api.tesser.sh/.well-known/jwks.json, so a box can only ever answer for itself. A revoke tells the box to hang up. - One Durable Object per box holds that socket and carries every request and websocket for the box over it, with flow control on bodies in both directions.
- Viewers come through Access. The Worker checks the
Cf-Access-Jwt-Assertionheader on every request against your team’s keys and the application’s audience tag. - Waking needs no secret. When a viewer opens a sleeping box, the Worker passes the viewer’s Access token to Tesser, which checks it against the team and audience you set and wakes the box.
http://localhost:<port>, so Vite’s allowedHosts and Next’s
allowedDevOrigins need nothing added. The gateway adds a small script to
each page that sends the page’s fetch, XMLHttpRequest, WebSocket, and
EventSource calls, links, and forms aimed at localhost:<port> through the
gateway, and redirects to localhost:<port> come back as gateway addresses.
Image, stylesheet, and other resource URLs aimed at localhost:<port> are
rewritten the same way, including ones the page’s scripts add later.
The ports a page can reach this way are the box’s own declared ports plus
the ports it reaches through its dependencies: each [deps] port on the box,
and the ports of the boxes behind them, followed down the dependency chain.
That chain only passes through the boxes of the person who shared the box
and the org’s shared instances. A port served by another member’s own box is
not reachable, and the gateway answers 404 for it. After a tesser wire
changes the box’s dependencies, the reachable ports update on their own.
Each port’s site keeps its own cookies, where localhost shares them across
ports, and a third-party sign-in only returns to a gateway address if the
provider allows it as a callback.