Putting things in your pen
One command puts something in your pen with its own name and the padlock. Everyone in the pen can open it; nobody outside can find it. This is how almost everything gets into a pen: a folder of photos, an app, a website you're building.
$ ./hogman-join share photos ~/holiday • Adding a server for photos.smith.hogman to your devices (alice) • Sharing the folder ~/holiday as https://photos.smith.hogman ✓ https://photos.smith.hogman is up. Everyone in the pen can open it. It shows the folder ~/holiday. Take it down and give the name back: hogman-join share stop photos
Use the same hogman-join you joined with, on a computer that's in the pen.
What you can put in
| You have | Command |
|---|---|
A folder of files or a finished website. An index.html becomes the front
page; otherwise visitors see a list of the files. |
share photos ~/holiday |
| An app running on this computer: a photo gallery, a forum, a wiki, a website you're building. Use the port it runs on. | share blog 3000 |
| Something on your home network, such as a NAS or a media server. Only for things you mean the whole pen to reach. | share media http://192.168.1.20:8096 |
Keeping it running
A share runs until you press Ctrl-C. The name stays yours: run the same command later and it's back at the same address.
To keep it running after you close the window, add --background:
$ ./hogman-join share blog 3000 --background
On a Mac or Linux it keeps running after you close the terminal, until the computer restarts (on some Linux systems, until you log out). It doesn't start by itself after a restart yet; run the command again.
Listing and taking down
$ ./hogman-join share list https://blog.smith.hogman http://127.0.0.1:3000 (running in the background) $ ./hogman-join share stop blog ✓ https://blog.smith.hogman is down, and the name is free again.
share stop takes it down and gives the name back. Leaving the pen takes all of
this computer's shares down first. In more than one pen? Add --pen smith.hogman.
On an always-on computer
For something that should stay up, like a family forum, run it on a computer that's always on (an old laptop, a mini PC, a small cloud server) and share it from there. That computer doesn't need to join the pen first:
- On your pen's home page, press Get a share link and copy the link. It works once, for an hour.
- On the always-on computer, download
hogman-jointhe same way you did when you joined, and add the link to the end of the share command:$ ./hogman-join share forum 8080 'https://smith.pens.hogman.network/join#k=…&fp=…' --background
Use a server link, not an invite: an invite makes a new member.
Names
- The name becomes
https://NAME.yourpen.hogman: lowercase letters, digits and dashes. - First come, first served. If it's taken you're told, nothing is left behind, and you pick another. Each member can hold up to 50.
- Share names are one word, like
blogormy-notes.
Limits
- Shares don't come back by themselves after a restart yet.
- A computer that joined as a server needs a server link to share.
- Windows is untested.
How it works
Each share is a small device of its own, a server, run inside hogman-join with
Tailscale's tsnet. It joins the pen (with a one-time key the tool asks for in your
name, or the server link), claims its name, gets a 7-day certificate from the pen's own CA and
renews it, and listens on port 443 inside the mesh. Your laptop itself still accepts no
connections; nothing opens a port on your computer, and nothing needs administrator rights.
For developers: requests are passed to your app with X-Forwarded-For,
-Host and -Proto, and with the app's own Host header, so dev servers
that check it still work. WebSockets work.
Already run a web server such as Caddy or nginx, with several sites behind it? Share its port
(share blog 8080); the share handles the pen's name and certificate.
Something wrong or unclear on this page? Its source is in site/docs-src; issues and fixes welcome.