NanumOS

Tunnel — publish a home server without opening a port

What it does

A NanumOS server at home or in an office usually sits behind a router, so nobody outside can reach it. The tunnel lets that server call a NanumOS server that has a public internet address (the edge) first, and the edge brings each visitor down that line to the home server. No port forwarding and no fixed address are needed.

Basics

Think of a parcel locker. You never give out your home address: visitors go to the locker in town (the edge), and your home server has a private corridor to the locker that it keeps open. The locker only sends visitors who ask for a registered name down the corridor. What to do now: type tunnel status in the terminal.

How to use it

How it works

  1. tunnel origin on the home server connects out to the edge's tunnel door (TCP 7844). By default it keeps two lines (links 2), so one can drop while the other carries on. Two servers joined under the same name share the load and cover for each other.
  2. When a visitor reaches the edge's web door, the edge reads the request's Host: and looks up which home server owns that name in its origins list. A name not on the list gets 404; CONNECT or a request that names another site gets 400 — the edge is not an open proxy.
  3. Inside the one connection each visitor gets a small stream. Each stream has its own allowance (a 256 KiB window), so one big video does not hold up other visitors. Partial video requests (Range, 206) pass through unchanged.
  4. The home server only connects to the places in its own serve NAME ADDRESS:PORT lines. If the edge sent a wrong name, the home server refuses it.
  5. Both sides ping every 5 seconds; after three missed answers the line counts as down and is dialled again.
Technical details
  • Code: user/tunnel/tunnel.c (edge, origin, commands), noise.c (Noise_IK_25519_ChaChaPoly_BLAKE2b with Monocypher's X25519, ChaCha20-Poly1305 and BLAKE2b), proto.c (records, frames, the request header, invite codes). Contract docs/contracts/TUNNEL.md.
  • Frames: a 2-byte length + ciphertext (one frame); a frame = type 1 + stream number 4 + payload. Types: HELLO, OPEN (host name), OPEN_OK, DATA, FIN, RST, WINDOW, PING/PONG, BYE.
  • Files: edge edge.key, edge.conf, origins (name, public key, host names), invites (only a hash of each code); home server origin.key, origin.conf. State: /tmp/tunnel-UID/edge.state and origin.state (not saved).
  • HTTPS: the web door is plain HTTP today. Public HTTPS is the edge's httpsd (certificates and the reverse proxy, NFLARE-EDGE) taking the request and handing it to this web door.
  • Every parser on the receiving side (records, frames, the request header, invite codes, handshake messages) is fuzzed (tests/fuzz/tunnel).

Common questions

What this app takes

TakesVisitor requests that arrive at the edge (passed only to the service you published).
SendsHome server → the one edge you chose: the published service's answers and this machine's public key. Nothing goes anywhere else.
Turn offHome server: service tunnel stop · edge: tunnel revoke NAME --yes or service tunnel-edge stop.

NanumOS 0.1.15511 · 2026-11-25