qURL™ vs Your Own Token Proxy
What a homemade capability URL has to get right, and the two commands that replace it.
A homemade capability URL is a proxy that checks a secret token before passing requests to your app, plus a tunnel or public route to reach it. You then own token issue, expiry, single use, revocation, and teardown. qURL does that job with two commands: qurl publish connects to the app without exposing its origin, and qurl share prints a single-use link that expires within 24 hours.
Asked to give one person temporary access to a private app, many developers and coding agents reach for the same build: generate a random token, put a small proxy in front of the app that checks it, and expose the proxy through a tunnel. That works. This page covers what it takes to make it work well, and the two commands that replace it.
Share one app from the command line
qurl publish http://127.0.0.1:3000
qurl share <CRID>Architectural Difference
A homemade capability URL has five parts, and each one is yours to get right:
- A route in: the proxy needs a public address, usually a tunnel such as ngrok or Cloudflare Tunnel, which puts a front door to the app on the internet for anyone to probe.
- Token issue: unguessable tokens from a secure random source, stored hashed, and compared in constant time.
- Expiry and single use: a clock on every token, and an atomic check that marks a token used so two requests cannot both redeem it.
- Revocation: a way to end one token early without restarting the proxy or touching anyone else’s.
- Teardown: stopping the proxy and the tunnel when the work ends, so the route does not outlive the need.
qURL covers the same five with two commands. qurl publish registers the app and connects outbound without requiring a public origin. Close or restrict any separate public route to the app. qurl share prints a link for one recipient; with no flags it opens once and expires within 24 hours. With an account, the API revokes one link without touching the others, and qurl stop <CRID> stops serving the app.
Neither approach tells your app who the recipient is. A qURL link grants access to whoever opens it. The documented browser flow uses a browser session; a non-browser client can be admitted by network address, shared by other devices on that public IP. Keep your app’s own sign-in for anything sensitive.
The assembled architecture
The job: one person needs temporary access to one app on your machine. Built by hand, each request takes this path:
- The recipient opens https://<tunnel-host>/?t=<token> in a browser.
- The tunnel’s public edge forwards the request to the tunnel client on your machine.
- Your token gateway checks the token (known, unexpired, unused, not revoked), marks it used in the same atomic step, and sets a session cookie so the browser’s next requests pass.
- The gateway forwards the request to the origin, your app on 127.0.0.1, and rewrites redirects and cookies so they work under the tunnel host.
Every hop is yours to run: the tunnel is a public front door anyone can probe, the gateway is security code, and the token store has to survive a restart without bringing spent tokens back.
What a minimal gateway does, and what it leaves out
A first version checks ?t= against a stored value and proxies the request. That much turns away a visitor with no token. On its own it leaves these gaps:
- The token works for the first person who sees the URL in a chat log, a browser history or a Referer header.
- It is not single-use unless checking and marking it used happen in one atomic step.
- The page’s next request carries no token, so the gateway needs a session of its own, with its own expiry.
- An open WebSocket keeps running after the token expires.
- The app is not hidden: the tunnel host answers anyone who finds it.
Each gap is code and tests to write and keep. qURL ships the whole list as the default behaviour of two commands.
The same job with qURL
- Publish the app: qurl publish http://127.0.0.1:3000. It stays private, with no public address to probe.
- Let the recipient in: qurl share <CRID> --ttl 4h --session-duration 2h for one visit, or publish with --access invite_only and run qurl access invite <CRID> --email <address> for a named recipient.
- The recipient opens the link or the emailed invitation in a browser and lands in the app.
- Close access: qurl access revoke_invitation for one person, qurl restart <CRID> to end open sessions, qurl stop <CRID> to stop serving, or qurl delete <CRID> to retire the app for good.
qURL decides who reaches the app; your app’s own sign-in and permissions still decide what each person can do inside it.
Building something specialized? Start from the qURL API
- Mint links from your own backend after your own login: POST /v1/resources/{id}/qurls with expires_in, one_time_use, max_sessions and session_duration.
- Land each link on one page or object: target_path on a link for a local app opens that path and limits the session to it and the paths below it.
- React to access: the API lists each link’s status (active, consumed, expired or revoked) and open sessions, and webhooks report access events.
- Put a hosted origin behind qURL: qurl publish https://… --origin-header <name> (qurl 4.1.0 or later) adds a secret header to every request qURL forwards.
You keep the custom logic your product needs and drop the gateway, the token store and the tunnel.
Who handles each part
| Responsibility | Your own gateway | qURL |
|---|---|---|
| Issuing credentials | Your code: random tokens from a secure source, stored hashed | qurl share, the API or the SDK; email invitations with qurl access invite |
| Checking scope | Your code: which app, which paths | Each link is for one published app; through the API, target_path limits a session to one path and the paths below it |
| Expiry | A clock on every token | --ttl on each link: 24 hours at most without an account, 30 days with one |
| Replay and use limits | An atomic redeem, so two requests cannot both win | Single use is the default for qurl share; the API sets one_time_use and max_sessions |
| Knowing who it is | Your own email loop or sign-in integration | invite_only admits only the invited mailbox, with a passkey; review lets you approve each verified email |
| App routing | Rewrite redirects and cookies; pass WebSocket upgrades through | Every path of the app answers during the session; WebSockets and Server-Sent Events pass through |
| Session behaviour | A session cookie you sign, scope and expire | --session-duration, 1 hour by default and 24 hours at most; at its end new requests are refused and open streams are cancelled |
| Revocation | A revoked list checked on every request | Revoke one invitation; with an account, revoke one link through the API; qurl restart ends open sessions |
| Restarts | Persist tokens and sessions, or every link breaks on redeploy | A background service keeps serving after you close the terminal and reconnects after sleep; the CRID never changes |
| Observability | Your logs | qurl access list_invitations and list_grants; with an account, each link’s status, open sessions and access webhooks |
Feature Comparison
| Feature | qURL | Your Own Token Proxy |
|---|---|---|
| A route in | An outbound connection; no inbound port to open | A tunnel or public route to your proxy |
| Issuing tokens | qurl share, the SDK, or the API | Your code: random tokens, stored hashed |
| Expiry | Set on each link; at most 24 hours without an account | Your code |
| Single use | The default for qurl share | Your code, with an atomic redeem |
| Revoking one recipient | Revoke that link through the API; other links keep working | Your code |
| Adding the app’s own credential to requests | Yes: qurl publish --origin-header for a hosted origin; an advanced CLI setup for a local app | Yes: the proxy can add any header |
| Code you maintain | None | The proxy, the token store, and the tunnel setup |
Which one to use
Choose qURL to
One person or agent, one private app, for a while: a client preview, a contractor’s look at an internal page, or a private test target for an agent. Two commands and no separate proxy to maintain.
Already built your own?
If you run a token proxy behind a tunnel today, qURL replaces both with two commands: qurl publish connects to the app without exposing its origin, and qurl share issues the links, with expiry, single use and revocation handled for you. With qURL, the proxy, the token store and the tunnel become code you no longer maintain.
qURL connects outbound, so you can share your app without opening an inbound port. Keep any other public routes to your app restricted. A link’s expiry controls when it can be opened; an opened session has its own duration. Explore access and revocation.
Frequently Asked Questions
What is a capability URL?
A URL that carries its own access authority: whoever holds it can use it, within its expiry, use limits, and policy. A qURL link is one, and so is a homemade token link. Either way, treat the link as a secret.
Is a random token in a URL secure enough?
It can be, if the token is long and random, sent only over HTTPS, kept out of logs and referrer headers, and limited in time and uses. The risk sits in the parts around it: a proxy exposed through a public tunnel can be found and probed, and a token that never expires keeps working wherever it was pasted.
Can qURL add my app’s Authorization header?
Yes, without building a separate proxy. For a hosted origin, qurl publish <https URL> --origin-header Authorization (qurl 4.1.0 or later) asks for the value with input hidden and adds it to every request qURL forwards, replacing the visitor’s own. For an app on your machine, a program that runs qurl supplies the headers through the CLI’s local control interface; see the qurl CLI README on GitHub (layervai/qurl-integrations, apps/cli/README.md).
How is this different from a public tunnel?
A public tunnel exposes an endpoint and can protect it with authentication. LayerV connects outbound and gives you a private, expiring way into one resource at a time, without exposing the origin through a public tunnel. A teammate or AI agent can use the app without a public deployment or access to your wider network.
Who can open a qURL link?
Whoever holds it, once: with no flags, qurl share prints a single-use link. The documented browser flow starts a session for that browser, which lasts 1 hour by default for an app published from the CLI; another browser on the same public IP cannot use that browser session. A script or agent that opens the link without a browser can be admitted by its network address, which other devices on that public IP may share until the session ends. Keep your app’s own sign-in for anything sensitive. A link admits whoever opens it: the API’s IP and country rules do not apply to the signed links qurl share issues.
Share your app without an account
Paste one prompt into your coding agent, or install the qURL CLI and publish the app yourself. No sign-up, no API key.
New to qURL? Start at qurl.link