Hosted tunnel products — ngrok, Cloudflare Tunnel, gsocket.io — all share one architectural trait: your sessions travel through their hardware. That is the trade that buys you zero setup, and it is usually worth it until it suddenly is not. The costs only surface once you lean on the tool in earnest.
GG-Socket starts from the opposite premise: the relay is software you run on your own VPS, carrying traffic only between machines you pointed at it, with no middleman in the path. Here is why that distinction earns its keep.
Reason 1: The Data Path Is Yours
With a hosted service, the provider’s relay sits squarely in the middle of every session. The link may be TLS-encrypted, yet the relay still terminates that TLS — or at minimum handles the TCP flow — and therefore holds:
- Connection timing and cadence (metadata)
- The addresses of the machines you connect to
- Whatever a TLS-terminating relay could observe if it chose to
For a weekend project that trust is fine. For production systems, customer data, or anything regulated, it is not.
With GG-Socket the relay is a Go process on a box you control. It terminates TLS only to read the secret key that decides who pairs with whom, then forwards encrypted bytes between the two peers without interpreting them.
Reason 2: Uptime on Your Terms
Hosted services go down. ngrok has had multi-hour outages; Cloudflare Tunnel has weathered incidents of its own; a small hosted relay is only as reliable as the team behind it — good, but not yours to guarantee.
When the access layer is down, every machine depending on it is out of reach. At three in the morning during an incident, “the tunnel is down” is about the worst line you can read.
A self-hosted relay is a single Go binary on a cheap VPS. It has:
- No external dependencies to rotate or break — no managed databases, no API keys
- Restart-on-failure via Docker’s restart policy
- A redeploy path that is one command
- No rate ceiling imposed from the outside
Its availability is a function of your own server — provider, region, and redundancy are all your call.
Reason 3: Limits Become Knobs
Every hosted relay throttles to survive abuse from all of its users at once. Sensible for them, but it means your legitimate traffic is bounded by a policy written for the worst case.
GG-Socket hands you the dials instead: a per-IP limiter (GGSOCKET_RELAY_RATE_LIMIT, default twenty new connections a minute) and a capacity semaphore (GGSOCKET_RELAY_MAX_CONNS, default ten thousand). Both exist to protect your relay from runaway loops — not to enforce a tier.
Outgrow them and you change two environment variables. The ceiling is whatever your hardware will hold.
Reason 4: Residency and Auditability
In regulated settings — healthcare, payments, government work — the question is not merely “is it encrypted?” but “does any byte traverse infrastructure outside our control?” Hosted tunnels fail that question by construction: sessions pass through servers that may sit in jurisdictions you did not choose, and proving a negative to an auditor is hard.
With the relay on your own VPS, in the region you selected:
- Data residency is explicit — you picked the provider and the region
- No outside party has any access to the relay host
- The relay is open source — you can read exactly what it does
- Logs never leave your box unless you ship them yourself
The Honest Trade: Setup
Self-hosting costs setup. You need a VPS, a domain, and the couple of minutes it takes to bring up the stack. For a single throwaway connection that is overkill.
But it is a one-time cost. Once the relay is up, each new tunnel is just two peers sharing a secret:
docker compose up -d --build
The stack handles TLS, matching, metrics, and recovery on its own. Per-tunnel operational overhead is effectively nil.
What Comes in the Box
Self-hosting here does not mean reinventing the wheel. GG-Socket ships with:
- A Go relay — one static, CGO-free binary, easy to read and audit
- A Docker Compose stack — relay and notification proxy wired together in a single
up - TLS on 443 — self-signed on first run, or your own cert mounted in
- Rate limiting and a capacity cap — protecting the relay under load
- Prometheus metrics — live sessions, bytes, and rejection counters at
/metrics - Quiet first-run alerts — a check-in is acknowledged instantly and forwarded to Telegram in the background
- Credential recovery — a Basic-Auth
/recoverpage that returns a lost session password by secret key
Getting Started
Bring the stack up on any Linux VPS with Docker:
# On your VPS
git clone <repo> gg_socket && cd gg_socket
# Configure the notification secrets
cp notify.env.example notify.env
nano notify.env
# Deploy the relay + notify proxy
docker compose up -d --build
From there the relay is live on your domain, and every tunnel is two peers dialling a shared secret. No third party is in the path at any step.
Own the relay. Own the path.
Two containers, one secret, no middleman — ever.
docker compose up -d --buildDeploy Your Relay →