sharnix docs

Sharnix

Share an app running on your machine over a public link — in one command. No deploy, no Dockerfile, no config. The person you send it to opens a normal URL in their browser; the traffic tunnels back to your localhost.

New here? Jump to the Quickstart — you'll have a shareable link in under a minute.

How it works

You run a small agent next to your app. It opens an outbound connection to the Sharnix relay and gets you a public link. When someone visits that link, the relay forwards each request through the agent to your local app, and streams the response back.

visitor ──▶ relay (sharnix.com) ──▶ agent (your machine) ──▶ http://localhost:PORT

Quickstart

With your app already running locally (say on port 3000):

1
Share it. In your project directory, run:
npx @sharnix/agent --port 3000 --share
First run, it walks you through a one-time login, then prints a public URL.
2
Send the link. Anyone who opens it sees your app. By default it's read-only — they can look, not submit.
3
Need them to interact? (chat, forms, editing) Share with full access:
npx @sharnix/agent --port 3000 --share --permission full
Always run one agent per app. Starting --share twice for the same app makes two agents fight over the tunnel. Recent agents refuse the second automatically — if in doubt, stop the old one first.

Share your app

The link you get looks like https://<name>.preview.sharnix.com/?t=…. The token in the URL is what grants access and carries the link's rules. Treat the link like a password — anyone with it gets whatever access you granted.

Confirm the port your app listens on before sharing. If you're not sure, open http://localhost:PORT yourself first — Sharnix can only share what already works locally.

Link permissions

Every link has one of three access levels:

LevelWhat visitors can doUse it for
read-only (default)Browse / view. All writes (POST/PUT/DELETE) are blocked.Look-only previews, sharing a UI for feedback
fullEverything, including submitting data.Apps people need to use: chat, forms, editing, dashboards
blockedNothing — link is temporarily disabled.Pausing access without deleting the link
Interactive apps need full. If a chat box, form, or "Save" button "fails" on a read-only link, that's by design — those are writes. Switch the link to full (the URL stays the same) and it works. See Troubleshooting.

Changing a link in place

You don't need to create a new link to change access. From your dashboard, open the link and switch read-only ↔ full — the same URL updates immediately. (Creating a new link instead is the usual reason for "I made it full but it still fails" — you're opening the old one.)

Restrictions & limits

Lock a link down to exactly who, where, and when:

LimitWhat it does
Specific peopleAllow only listed emails — visitors verify by email before entering.
A whole companyAllow an entire domain, e.g. anyone @acme.com.
LocationAllow only chosen countries.
NetworkAllow only specific IPs / ranges.
TimeAuto-expire after N hours, or a start/end window.
One lookLink works once, then closes.

Restricting by person/company turns on a quick email login so the visitor proves who they are. All of these apply to the link you share — including styled frontends. Some options are plan-gated (see Plans).

Subdomains

Every tunnel automatically gets a stable subdomain like sx-abc123.preview.sharnix.com. That's what lets modern frontends (Next.js, Vite, SvelteKit, etc.) load their CSS/JS correctly, because the assets resolve on the same origin.

You generally don't need to do anything here — sharing just works. Claim a named subdomain only when you want a branded, permanent URL.

Keep a link alive

A link from a terminal --share goes offline the moment you close that terminal — visitors then see "preview paused". To keep it up across terminal-close, sleep, and reboot, install the background service:

npx @sharnix/agent service install
npx @sharnix/agent service start
npx @sharnix/agent service status
The service keeps the tunnel alive — your app still has to be running for the preview to load.

When an agent disconnects, Sharnix automatically pauses its links (so nobody sees a broken page) and reactivates them when the agent returns.

Use Sharnix from AI agents (MCP)

Sharnix is built to be driven by AI coding agents. Point your agent at the relay and it can share apps, manage links, and flip permissions for you.

Just say something like "Sharnix share my app" or "make the share link full so they can use the chat" and the agent handles the rest.

Plans

FeatureFreeProTeam
Tunnels & links✓ (basic limits)✓ more✓ lots
read-only / full / blocked, expiry, one-time, auto subdomain
Require viewer login + email/people limits
Named subdomain, visit analytics
IP / country allowlists, custom domains

When a feature needs a higher plan, Sharnix tells you and offers the free alternative. Upgrade at relay.sharnix.com/app/settings.

Troubleshooting

Most issues are one of these. Quick checklist first: one agent running? tunnel connected? app works on localhost? link read-only or full?

What you seeWhat it means & what to do
Chat / form / Save fails, but pages loadThe link is read-only; writes are blocked. Switch it to full (same URL).
"Made it full but still fails"You're opening the old link. Change the existing link in place, or open the new URL.
"Tunnel offline" / "Preview paused"The agent isn't connected. Start it again; reactivate the link if it stays paused.
Gateway error / 502 on everythingRelay can't reach your agent: agent stopped, two agents fighting, or your connection is dropping. Ensure one agent, connected, and your app is up.
Agent loops on "reconnecting…"Often a network that advertises IPv6 it can't use (mobile/hotspot). Update: npx @sharnix/agent@latest. If it persists, your connection is unstable.
"A Sharnix agent is already sharing this app"Good — single instance is enforced. Reuse the live link, or stop the other agent first.
Chat hangs, then fails after ~30–60sOld agent that can't stream. Update: npx @sharnix/agent@latest.
"Upgrade required"That option is on a higher plan. Use the free alternative or upgrade.
Works, then breaks intermittentlyYour machine's connection to Sharnix is dropping packets (common on mobile/CGNAT). Test with the command below; retest on a steadier network.
# Is your connection to Sharnix healthy? Run a few times:
curl -s -o /dev/null -w "%{http_code}\n" https://relay.sharnix.com/health

If you see timeouts or non-200 results, the problem is your network — no setting fixes packet loss; the agent reconnects on its own once it recovers.

FAQ

Is my machine exposed to the internet?

No. The agent only makes outbound connections to the relay. There's nothing to open on your firewall, and visitors never connect to your machine directly.

Do I need to deploy or build anything?

No. Sharnix shares whatever is already running on your localhost. Close the agent and the link goes away.

Can I revoke a link?

Yes — revoke it from the dashboard and visitors immediately get a "gone" page. Revocation is permanent.

How is this different from a normal deploy?

It's instant and disposable: one command, no infra, and it serves the exact code running on your machine right now — ideal for demos, client review, testing webhooks, and letting an AI agent show you a working change.

Need more? Agents read the full playbook at relay.sharnix.com/skill.md. Powered by Sharnix.