chore: restart the repository with a clean history
CI / Docker image (push) Successful in 12s
CI / Server (push) Successful in 25s
CI / CLI (push) Successful in 13s
Development image / Development image (push) Successful in 21s
CI / CLI (windows) (push) Successful in 57s
CI / CLI (linux-arm64, static) (push) Successful in 1m37s
Release / Prepare release (push) Successful in 2s
Release / Server (linux-x64) (push) Successful in 53s
Release / CLI (linux-arm64, static) (push) Successful in 1m32s
Release / Docker image (push) Successful in 2m48s
Release / Server (windows-x64) (push) Successful in 6m20s
Release / CLI (windows-x64) (push) Successful in 6m48s
Release / CLI (linux-x64) (push) Successful in 7m8s
Release / Publish release (push) Successful in 1s

Squash the tree into one commit, drop docs/architecture.html, reset the version line to 0.3.0, consolidate the changelog, enable Renovate automerge for non-major updates and add AGENTS.md.
This commit is contained in:
fristy committed 2026-11-10 11:31:13 +03:00
commit 650807c1fb
438 files changed
+45070

No files matched your search

+61
View File
@@ -0,0 +1,61 @@
import { defineConfig } from "vitepress";
export default defineConfig({
title: "frislit",
description: "Self-hosted tunnels: subdomain, path and direct TCP/UDP behind one public port",
lastUpdated: true,
cleanUrls: true,
metaChunk: true,
head: [
["link", { rel: "icon", type: "image/svg+xml", href: "/logo.svg" }],
["meta", { name: "theme-color", content: "#0D9488" }],
["meta", { property: "og:type", content: "website" }],
["meta", { property: "og:locale", content: "en" }],
["meta", { property: "og:title", content: "frislit | Self-hosted tunnels behind one public port" }],
["meta", { property: "og:site_name", content: "frislit" }],
["meta", { property: "og:image", content: "/logo.png" }],
["meta", { property: "og:image:type", content: "image/png" }],
["meta", { property: "twitter:card", content: "summary" }],
["meta", { property: "og:url", content: "https://docs.git.fristy.net/fristy/frislit" }],
],
themeConfig: {
logo: "/logo.svg",
nav: [
{ text: "Home", link: "/" },
{ text: "Install", link: "/installation" },
{ text: "CLI", link: "/cli" },
],
footer: {
message: "Distributed under the MIT License",
copyright: "© 2026 Mathias Wagner",
},
search: {
provider: "local",
},
sidebar: [
{
text: "Documentation",
items: [
{ text: "Home", link: "/" },
{ text: "Introduction", link: "/introduction" },
{ text: "Install", link: "/installation" },
{ text: "Configuration", link: "/configuration" },
{ text: "HTTPS", link: "/https" },
{ text: "Reverse Proxy", link: "/reverse-proxy" },
{ text: "CLI", link: "/cli" },
{ text: "Persistent tunnels", link: "/persistent" },
{ text: "Running as a service", link: "/service" },
],
},
],
socialLinks: [
{ icon: "github", link: "https://git.fristy.net/fristy/frislit" },
{ icon: "discord", link: "https://dc.gnmyt.dev" },
],
},
});
+276
View File
@@ -0,0 +1,276 @@
# ⌨️ CLI
The frislit CLI (`frislit`) is a single static binary. It opens one WebSocket to your server and pipes bytes between
your local port and the visitors - nothing else runs on your machine.
## Installation
`apt`, `dnf`, a Windows installer or a single binary, all in [Installation](/installation).
## Getting started
```sh
frislit login
```
You are asked for the server URL, and the CLI then prints a short code and opens the approval page in your
browser. Sign in there with your frislit account and approve the device. The CLI is handed a token **of its own**,
saved to `~/.config/frislit/config.json` (`%APPDATA%\frislit\config.json` on Windows,
`~/Library/Application Support/frislit/config.json` on macOS).
There is no shared secret: every machine holds its own token, and each one can be revoked separately under
**Settings**, **Devices** in the web UI.
### Invite links
Someone without an account can tunnel through your server with an invite link, created under **Settings**, **Devices**
in the web UI. Opening the link offers "Open in frislit" and the command to run:
```sh
frislit login https://frislit.example.com/@frislit/invite/<token>
```
After that everything works as usual. Tunnels opened this way show up under your account with the invite's label,
and revoking the link closes them.
### API keys
For a machine without a browser, CI, or scripts, create an API key under **Settings**, **Devices** in the web UI and link
with it directly:
```sh
frislit login --server https://frislit.example.com --token <key>
```
A key is a device like any other: it shows up in the list, can be revoked there, and revoking it closes its tunnels.
`FRISLIT_SERVER` and `FRISLIT_TOKEN` override the saved server URL and token for one-off runs.
## Commands
Every mode accepts the local target as a plain port (`3000` means `127.0.0.1:3000`) or `host:port`
(`192.168.1.5:8080`). `frislit http` also takes a URL: `https://localhost:8443` makes the CLI speak TLS to the target,
and a bare `host:443` is treated the same way. The certificate is not checked, since it is usually self-signed on a
dev machine, so the tunnel works with whatever the app presents. Visitors still get the server's own certificate.
`frislit http` also accepts a **directory**. frislit then serves it with a built-in static file server, so you can skip
`python3 -m http.server`:
```sh
frislit http . # share the current folder
frislit http ./dist # share a build output
```
`index.html` is served for directories that have one, everything else gets a directory listing. The server only ever
runs on `127.0.0.1` on a random port and stops together with the tunnel.
### HTTP tunnel
```sh
frislit http 3000
frislit http 192.168.1.5:8080 --name myapp
frislit http https://localhost:8443
frislit http ./public --name site
```
The server decides how the tunnel is exposed (`httpMode` in its configuration): on its own subdomain
`https://myapp.frislit.example.com`, or under `https://frislit.example.com/@myapp` in path mode. The CLI prints whatever
it got. See [Introduction](/introduction) for what each mode does to the URL.
```
✓ Tunnel myapp is online
https://myapp.frislit.example.com forwards to 192.168.1.5:8080
[QR code]
✓ Copied to clipboard
Press Ctrl+C to stop.
```
### Routing by path
One tunnel can send different paths to different places:
```sh
frislit http 3000 --route /api=4000 --route /docs=./site
```
The positional target takes everything that matches no route; the longest matching prefix wins. Ports and
`host:port` targets receive the full path, directories are mounted at their prefix (`/docs/guide.html` serves
`./site/guide.html`). In `tunnels.yml`:
```yaml
tunnels:
shop:
http: 3000
routes:
/api: 4000
/docs: ./site
```
### Simulating a bad connection
```sh
frislit http 3000 --latency 200ms --jitter 50ms --bandwidth 512kbps --loss 2%
frislit tcp 27015 --latency 80ms --loss 5%
```
| Flag | Description |
|------------------------|------------------------------------------------------------------------------|
| `--latency <duration>` | Added in each direction, `200ms` or `1s`. |
| `--jitter <duration>` | Random extra delay, 0 to this value. |
| `--bandwidth <rate>` | Cap per direction, `512kbps`, `2mbps` or `100kB/s`. |
| `--loss <percent>` | UDP datagrams are dropped; TCP data stalls instead, like a retransmit would. |
Applies between the CLI and your app, so every mode is covered. In `tunnels.yml` for [`frislit start`](/service):
```yaml
tunnels:
shop:
http: 3000
shape:
latency: 200ms
jitter: 50ms
bandwidth: 512kbps
loss: 2
```
### Protecting a tunnel
```sh
frislit http 3000 --password hunter2 # ask visitors for a password
frislit http 3000 --require-login # ask visitors for a frislit account
frislit serve --allow 10.0.0.0/8 # only this range may connect
frislit http 3000 --allow-country de,at,ch # only these countries
frislit http 3000 --block tor --block vpn # no Tor exit nodes or VPNs
frislit tcp 25565 --block-country ru # rules work for tcp too
```
| Flag | Description |
|---------------------------|--------------------------------------------------------------------|
| `--allow <cidr>` | Only these addresses or ranges. |
| `--allow-country <code>` | Only these countries, two-letter codes. |
| `--block-ip <cidr>` | Never these addresses or ranges. |
| `--block-country <code>` | Never these countries. |
| `--block <category>` | Never `tor`, `vpn`, `datacenter` or `blocklist` addresses. |
| `--password <password>` | HTTP only. Visitors get a password prompt, `curl -u any:<password>` works. |
| `--require-login` | HTTP only. Visitors sign in on your frislit login page, passkeys and SSO included. `curl -u` works for accounts without two-factor. |
All flags repeat or take comma-separated values. Block rules win over allow rules. `--password` and `--require-login`
are mutually exclusive. Rules can be changed later in the web UI, the CLI prints the new rules and they survive a reconnect.
While the tunnel is open the CLI shows a terminal UI: the public address, live request rate, p50 and p90, and a table
of requests with status, duration, client address and location. Arrow keys select a row, `c` copies the URL, `o`
opens it in the browser, `d` opens the tunnel in the web UI, `q` quits.
Pass `--plain` to get one line per request instead, which is also what you get when the output is not a terminal:
```
GET 200 / 3ms DE · Hetzner Online · datacenter
GET 404 /favicon.ico 1ms US · Comcast
WS 101 /socket 4210ms NL · Tor · tor
```
The same requests are kept server-side and shown in the web UI, with their headers and bodies; WebSocket connections
show their messages. From there requests can be replayed, or everything exported as a HAR file for browser devtools.
Options:
| Flag | Description |
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--name <name>` | Request a custom id (`a-z`, `0-9`, `-`, 3-32 characters). Fails if it is taken or [reserved](/persistent) by someone else. |
| `--keep-host` | Send the public hostname as `Host` to your app instead of `192.168.1.5:8080`. By default the local authority is sent so dev servers like Vite or Django don't reject the request; the public host is always available in `X-Forwarded-Host`. |
### Direct TCP + UDP
```sh
frislit tcp 25565
```
```
✓ Tunnel k3x9ab is online
Forwarding 127.0.0.1:25565 (tcp+udp)
Share code: k3x9abQ7wRkZb2m9pLdXe8vC4nHtY1sK
Others run: frislit connect k3x9abQ7wRkZb2m9pLdXe8vC4nHtY1sK --server https://frislit.example.com
[QR code]
✓ Copied to clipboard
Press Ctrl+C to stop.
```
TCP and UDP on the target port are forwarded automatically, there is no flag to pick one. Several people can use the
same share code at once.
### Connecting to a shared port
```sh
frislit connect https://frislit.example.com/@frislit/connect/k3x9abQ7wRkZb2m9pLdXe8vC4nHtY1sK
```
That link is what `frislit tcp` prints and copies to the clipboard: it carries the server and the code together,
so the other side pastes one thing and needs nothing else. Opening it in a browser shows the same command with a
copy button.
```
✓ Forwarding 127.0.0.1:25565 (tcp+udp) to k3x9ab
Press Ctrl+C to stop.
```
`connect` needs **no account and no device token**: the link is enough. A bare share code works too, as long as
the server is known from `--server`, `FRISLIT_SERVER` or an earlier `frislit login`. It binds a TCP listener and a
UDP socket on the same local port. By default that is the owner's
port number; if it is taken you are asked for another one.
| Flag | Description |
|------------------|---------------------------------------------------------------------------------------------------------------|
| `--port <port>` | Local port to bind instead of the owner's port. |
| `--bind <addr>` | Local address to bind (default `127.0.0.1`). Use `0.0.0.0` to let other machines in your LAN use the forward. |
| `--server <url>` | frislit server URL. Only needed when a bare code was pasted instead of the link. |
### Listing tunnels
```sh
frislit ls
```
Your tunnels on the server, online or not, with their addresses. Persistent ones are marked with `*`.
`frislit status` does the same.
### Configuration
```sh
frislit config show
frislit config get server-url
frislit config set server-url https://frislit.example.com
frislit config set device-token <token>
frislit config set accept-invalid-certs true
```
Keys: `server-url`, `device-token` (shown as `(set)`), `accept-invalid-certs` (for self-signed certificates on the
server).
### Update
```sh
frislit update
```
Downloads the latest release and replaces the binary, or runs the new installer on Windows. Installations from a
package manager are left to it.
### Logout
```sh
frislit logout
```
Removes this device's token; the server URL is kept. Revoke it on the server too, under **Settings**, **Devices**.
## Reconnects
An **administrator closing the tunnel**, or disconnecting a client from the web UI, ends the session for good: the
CLI prints the reason and exits. Reconnecting only applies to connections that dropped on their own.
If the connection to the server drops, the CLI shows a spinner and reconnects with exponential backoff. As long as it
gets back within the server's grace period (30 s by default) the tunnel keeps its id, URL and share code and joiners
stay connected. Visitors see a "tunnel offline, reconnecting" page in the meantime.
Ctrl+C tells the server to release the tunnel immediately, without waiting for the grace period.
+56
View File
@@ -0,0 +1,56 @@
# ⚙️ Configuration
The server reads a YAML file (`/app/data/config.yml` in the image, override the path with `FRISLIT_CONFIG`). Every
key can also be set through an environment variable, which beats the file, and anything you save in the web UI
beats both.
Nothing is required up front. Without a `baseDomain` the server starts in **setup mode** and serves only
`/@frislit/**` until you finish the setup wizard in the browser.
```yaml
listen: 0.0.0.0
port: 8080
baseDomain: frislit.example.com
publicUrl: https://frislit.example.com
trustProxy: true
httpMode: subdomain
gracePeriod: 30
```
| Key | Environment variable | Default | Description |
|---|---|---|---|
| `listen` | `FRISLIT_LISTEN` | `0.0.0.0` | Address the HTTP server binds to. |
| `port` | `FRISLIT_PORT` | `8080` | The one and only port. HTTP, WebSockets and the CLI control channel all use it. |
| `baseDomain` | `FRISLIT_BASE_DOMAIN` | - (setup) | Your tunnel domain. Subdomain tunnels become `<id>.<baseDomain>`, path-mode tunnels live on `<baseDomain>` itself. |
| `publicUrl` | `FRISLIT_PUBLIC_URL` | `https://<baseDomain>` | What the server prints as the public URL. Use `http://…` for local testing without TLS. |
| `tlsMode` | `FRISLIT_TLS_MODE` | `proxy` | `proxy` if something terminates TLS in front of frislit, `acme` if frislit should get its own certificates. Set through the environment, it cannot be changed in the web UI. See [HTTPS](/https). |
| `trustProxy` | `FRISLIT_TRUST_PROXY` | `false` | Use `X-Forwarded-Host`, `X-Forwarded-Proto` and `X-Forwarded-For` from nginx. Turn this on only when nothing but your proxy can reach the port: the IP allowlist and the login rate limit both believe whatever address these headers carry. |
| `httpMode` | `FRISLIT_HTTP_MODE` | `subdomain` | How `frislit http` tunnels are exposed. `subdomain`: `https://<id>.<baseDomain>` (needs the wildcard DNS record and certificate). `path`: `https://<baseDomain>/@<id>`, bound per browser tab (no wildcard needed). |
| `gracePeriod` | `FRISLIT_GRACE_PERIOD` | `30` | Seconds a tunnel id stays reserved after the owner's CLI drops. The CLI reconnects automatically and keeps the same URL/share code. Ctrl+C releases immediately. |
`listen` and `port` are only read at startup. Everything else can be changed in the web UI and takes effect
immediately.
Other environment variables:
| Variable | Description |
|---|---|
| `FRISLIT_CONFIG` | Path to the YAML file. |
| `FRISLIT_DATA_DIR` | Where the database is kept. `/app/data` in the image. |
| `LOG_LEVEL` | `error`, `warn`, `info` (default) or `debug`. |
## 💾 Data directory
The data directory (`/app/data`, or `FRISLIT_DATA_DIR`) holds one file, `frislit.db`: accounts, sessions, devices,
tunnel access rules, certificates, the requests a tunnel has served and the settings you changed in the web UI.
It is SQLite. Passwords are scrypt hashes and device tokens are stored hashed, so a copy of the file does not hand
anyone a working login. The schema is created and upgraded automatically on startup.
Only settings you actually change in the UI are stored; anything you leave alone keeps coming from `config.yml` or
the environment, which is why server configuration stays reviewable in a file you can put in git.
![Forwarding settings](/screenshots/settings.png)
Back it up (or mount `/app/data` in Docker) to keep accounts, devices and access rules across restarts. Delete it
to start over with the setup wizard.
+81
View File
@@ -0,0 +1,81 @@
# 🔒 HTTPS
frislit never speaks plain HTTP to the internet. Two ways to get there, and you pick one during the guided setup or
later under **Settings**, **HTTPS**. The options for the other one stay out of your way.
## 🧭 Which one
| | Behind a proxy | frislit manages it |
|---|---|---|
| Certificate | your proxy holds it | frislit orders it from Let's Encrypt |
| frislit listens on | one plain HTTP port | `443`, plus `80` for redirects |
| Renewal | your proxy's job | automatic, 30 days before expiry |
| Needs | nginx, Caddy, Traefik… | a DNS API token, or port 80 reachable |
Pick **behind a proxy** if something already terminates TLS on that machine, or if you want one certificate for
several services. Pick **frislit manages it** if frislit is the only thing on the box.
## 🛡️ Behind a proxy
The default. frislit serves plain HTTP on `port` (8080) and never sees a certificate. Set up nginx as described in
[Reverse proxy](/reverse-proxy), then turn on **Trust proxy headers** so tunnels see the real visitor address.
> [!WARNING]
> Only turn that on when nothing but your proxy can reach the port. The per-tunnel IP allowlist and the login rate
> limit both believe whatever `X-Forwarded-For` carries.
## 🔑 frislit manages it
frislit binds `443` for traffic and `80` for the redirect and HTTP challenges. In Docker that is just a port
mapping, because a container may bind low ports already:
```sh
docker run -d --name frislit --restart always -p 443:443 -p 80:80 \
-v frislit-data:/app/data \
-e FRISLIT_BASE_DOMAIN=frislit.example.com \
-e FRISLIT_PUBLIC_URL=https://frislit.example.com \
-e FRISLIT_TLS_MODE=acme \
fristy/frislit:latest
```
### Which challenge
| Forwarding mode | Certificate | Challenge |
|---|---|---|
| Path | `frislit.example.com` | HTTP, or DNS if you prefer |
| Subdomain | `frislit.example.com` **and** `*.frislit.example.com` | DNS only |
A wildcard can only be proven with a DNS challenge, which is a Let's Encrypt rule rather than a frislit one. Subdomain
forwarding therefore needs a DNS provider; path forwarding can get by with the HTTP challenge and no token at all.
### DNS providers
**Cloudflare**: create a token with `Zone:DNS:Edit` on the zone, paste it, and press *Test token*. frislit adds and
removes the `_acme-challenge` record on its own, including at renewal.
**Add the record yourself**: frislit shows the exact TXT record and waits. Fine for a first certificate, but
renewal needs you to be there again, so it is not a good long-term answer.
### The first certificate
Until there is one, a server in this mode serves the web UI over plain HTTP on port 80, because the page you would
request the certificate from is otherwise behind a handshake that cannot succeed. Finish the setup, open
**Settings**, **HTTPS**, press *Request certificate*, and the redirect takes over once it lands.
## ⚙️ Keys
| Key | Environment variable | Default | Description |
|---|---|---|---|
| `tlsMode` | `FRISLIT_TLS_MODE` | `proxy` | `proxy` or `acme`. When set through the environment it is fixed in the web UI, because the container's ports were mapped for it. Otherwise switching needs a restart. |
| `httpsPort` | `FRISLIT_HTTPS_PORT` | `443` | Where traffic is served in `acme` mode. |
| `redirectPort` | `FRISLIT_REDIRECT_PORT` | `80` | Redirects to HTTPS and answers HTTP challenges. |
| `acmeDirectoryUrl` | `FRISLIT_ACME_DIRECTORY` | - | Another ACME server: a private CA, Buypass, or Let's Encrypt staging while you are debugging. |
The contact email, the challenge and the DNS token are set in the web UI and stored in the database, not in
`config.yml`, because a token is a credential rather than configuration.
> [!TIP]
> Let's Encrypt rate-limits failed validations to five per hostname per hour. If you are working through a DNS
> problem and hit that, point `FRISLIT_ACME_DIRECTORY` at
> `https://acme-staging-v02.api.letsencrypt.org/directory` until it works. Staging certificates come from an
> untrusted CA, so browsers will warn about them. Switch back once the challenge succeeds.
+55
View File
@@ -0,0 +1,55 @@
---
layout: home
hero:
name: frislit
text: Self-hosted tunnels
tagline: Expose local ports through your own server - subdomain, path or direct TCP/UDP, all behind one public port
actions:
- theme: brand
text: Install
link: /installation
- theme: alt
text: Introduction
link: /introduction
- theme: alt
text: GitHub
link: https://git.fristy.net/fristy/frislit
image:
src: /logo.png
alt: frislit
features:
- icon: 🌐
title: Subdomain tunnels
details: frislit http 3000 gives your local app its own https://<id>.your-domain, with WebSockets and rewritten redirects. frislit http . shares a folder.
link: /introduction
linkText: Learn more
- icon: 🍪
title: Path mode
details: No wildcard certificate? Set httpMode to path and tunnels live under https://your-domain/@<id>, one per browser tab.
link: /introduction
linkText: Learn more
- icon: 🔌
title: Direct TCP + UDP
details: frislit tcp 25565 prints a share code. Others run frislit connect and get the port on their own machine, TCP and UDP.
link: /introduction
linkText: Learn more
- icon: 🔁
title: Reconnects
details: Lost your connection? The CLI reconnects with the same URL or share code inside the grace period.
- icon: 📱
title: QR & clipboard
details: Every URL and share code is printed as a terminal QR code and copied to your clipboard.
- icon: 🪶
title: Tiny footprint
details: A small Node.js server, a single static Rust binary, one YAML file and one SQLite file.
---
<style>
:root {
--vp-home-hero-name-color: #0D9488;
--vp-home-hero-image-background-image: linear-gradient(rgba(13,148,136,0.25), rgba(13,148,136,0.25));
--vp-home-hero-image-filter: blur(100px);
}
</style>
+101
View File
@@ -0,0 +1,101 @@
# 🚀 Installation
frislit consists of the **server** (Node.js) and the **CLI** (a single Rust binary called `frislit`).
## 🐳 Docker
```sh
docker run -d \
--name frislit \
--restart always \
-p 127.0.0.1:8080:8080 \
-v frislit-data:/app/data \
-e FRISLIT_BASE_DOMAIN=frislit.example.com \
-e FRISLIT_PUBLIC_URL=https://frislit.example.com \
-e FRISLIT_TRUST_PROXY=true \
fristy/frislit:latest
```
Then open `https://frislit.example.com/@frislit` and follow the setup wizard.
> [!IMPORTANT]
> Mount `/app/data`. That volume holds your admin account, the settings you change in the web UI and the generated
> CLI token - without it they are gone when the container is recreated.
## 📦 Docker Compose
```yaml
services:
frislit:
image: fristy/frislit:latest
restart: always
ports:
- "127.0.0.1:8080:8080"
volumes:
- frislit-data:/app/data
environment:
FRISLIT_BASE_DOMAIN: frislit.example.com
FRISLIT_PUBLIC_URL: https://frislit.example.com
FRISLIT_TRUST_PROXY: "true"
volumes:
frislit-data:
```
Prefer a file? Mount a `config.yml` to `/app/data/config.yml` instead of setting environment variables (see
[Configuration](/configuration)). Environment variables always win over the file.
> [!NOTE]
> Both examples above put a proxy in front, so they bind to `127.0.0.1` and set `FRISLIT_TRUST_PROXY`, which makes
> frislit believe the `X-Forwarded-*` headers it receives. frislit can hold its own certificate instead and bind 443
> itself; see [HTTPS](/https).
Then open `https://frislit.example.com/@frislit` and run the setup wizard, or skip it by mounting a `config.yml`
with `baseDomain` and `publicUrl` already filled in. Accounts and everything you change in the web UI live in the
mounted volume (see [Configuration](/configuration)).
## ⌨️ CLI
One line on Linux:
```sh
curl -fsSL https://git.fristy.net/fristy/frislit/raw/branch/main/packaging/install/install | sh
```
And on Windows:
```powershell
irm https://git.fristy.net/fristy/frislit/raw/branch/main/packaging/install/install.ps1 | iex
```
The script downloads the latest release from this repository: it runs the MSI installer on Windows, and puts the plain
binary in `/usr/local/bin` (or `~/.local/bin`) on Linux. macOS is not built by this fork; build from source with
`cargo build --release --manifest-path cli/Cargo.toml`.
### Manual download
Every release on <https://git.fristy.net/fristy/frislit/releases> carries the CLI binaries
(`frislit-linux-x64`, `frislit-linux-arm64`, `frislit-windows-x64.exe`, `frislit-windows-arm64.exe`), the MSI
installers (`frislit-x64.msi`, `frislit-arm64.msi`) and the `frislit-cli-*.deb` / `frislit-cli-*.rpm` packages.
There is no apt or rpm repository.
### Updating
```sh
frislit update
```
Replaces a plain binary in place, or downloads and runs the new installer on Windows. When frislit came from a package
manager it says so and leaves updating to it. The CLI checks for a new release once a day and mentions
it in the terminal UI, the desktop app shows an **Update and restart** button under Settings.
Then log in:
```sh
frislit login
```
Or open the desktop app with `frislit gui` and link the device there. `frislit links register` makes `frislit://`
links open in it.
Continue with the [CLI guide](/cli).
+41
View File
@@ -0,0 +1,41 @@
# 🚇 Introduction
frislit is a self-hosted tunnel server with a matching CLI. You run the server on a machine with a public address,
and the CLI on any machine that has something worth sharing. All traffic goes through **one public port**, so there
is nothing else to open in your firewall. frislit can hold its own certificate or sit behind a proxy you already
run, whichever you prefer.
![The tunnel list](/screenshots/tunnels.png)
## The three modes
HTTP tunnels are always created with `frislit http <port>`. Whether they end up on a subdomain or under a path is a
server setting, so everyone using a server gets the same kind of URL.
### 🌐 Subdomain - `httpMode: subdomain`
The classic ngrok experience. Your local HTTP server gets its own hostname like `https://k3x9ab.frislit.example.com`.
HTTP and WebSockets work, redirects that point at your local machine are rewritten to the public host.
### 🍪 Path / cookie - `httpMode: path`
For setups without a wildcard certificate, or when you want everything under one hostname. Visiting
`https://frislit.example.com/@k3x9ab` binds **that browser tab** to the tunnel, so two tabs can hold different
tunnels at the same URL. Refreshes, link clicks and form posts all stay on the tab's own
tunnel. For anything that is not a browser, name the tunnel in the query string:
`curl https://frislit.example.com/api?frislit-tunnel=<id>`.
Two things to know before choosing it: every path-mode tunnel lives on the same origin, so cookies and storage are
shared between the apps you open this way, and it only works over HTTPS or on `localhost`. Apps that need to be
isolated from each other belong on subdomains.
### 🔌 Direct TCP + UDP - `frislit tcp <port>`
No website at all. The owner gets a share code, the other side runs `frislit connect <code>` and gets the port on
their own machine - both TCP **and** UDP on the same port number, automatically. Perfect for game servers, SSH or
databases.
![The page behind a share link](/screenshots/connect.png)
Read on: [Installation](/installation) · [Configuration](/configuration) · [Reverse proxy](/reverse-proxy) ·
[CLI](/cli) · [HTTPS](/https) · [Persistent tunnels](/persistent)
+26
View File
@@ -0,0 +1,26 @@
# 📌 Persistent tunnels
A persistent tunnel is a name reserved for your account. Nobody else can use it, its access rules are kept, and it
can have custom domains. The target still comes from the CLI each time:
```sh
frislit http 3000 --name myapp
```
Reserve a name with **Reserve a name** on the Tunnels page, or press **Keep** on a running tunnel. **Release** makes it an
ordinary tunnel again. To keep it up without a terminal, see [Running as a service](/service).
## Custom domains
1. Create a `CNAME` for the hostname pointing at your base domain.
2. Add the hostname on the tunnel's page.
frislit checks DNS every few minutes and activates the domain once it resolves to the server. Traffic on it is
proxied like a subdomain tunnel, in both forwarding modes.
| `tlsMode` | Certificate |
|-----------|---------------------------------------------------------------------------------|
| `acme` | Issued by frislit over the HTTP challenge, served by SNI, renewed automatically. |
| `proxy` | Your reverse proxy handles it, see [Reverse proxy](/reverse-proxy). |
Hostnames under the base domain are not allowed; those are subdomain tunnels.
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

+7
View File
@@ -0,0 +1,7 @@
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M96 366V226A160 160 0 0 1 416 226V366"
stroke="#0D9488" stroke-width="62" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M196 374V226A60 60 0 0 1 316 226V374"
stroke="#0D9488" stroke-opacity="0.45" stroke-width="46" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M150 446H362" stroke="#0D9488" stroke-width="62" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 531 B

+7
View File
@@ -0,0 +1,7 @@
<svg width="398" height="458" viewBox="57 27 398 458" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M96 366V226A160 160 0 0 1 416 226V366"
stroke="#0D9488" stroke-width="62" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M196 374V226A60 60 0 0 1 316 226V374"
stroke="#0D9488" stroke-opacity="0.45" stroke-width="46" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M150 446H362" stroke="#0D9488" stroke-width="62" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

+81
View File
@@ -0,0 +1,81 @@
# 🔀 Reverse Proxy
> [!NOTE]
> This is one of two ways to serve HTTPS. frislit can also get its own certificates from Let's Encrypt and
> serve them itself, with nothing in front. See [HTTPS](/https).
In this mode frislit runs behind **nginx**, which terminates TLS for the base domain **and** every subdomain. You need:
1. A **wildcard DNS record**: `frislit.example.com` and `*.frislit.example.com` pointing at your server.
2. A **wildcard certificate** covering both `frislit.example.com` and `*.frislit.example.com`. With certbot this needs
the DNS challenge, for example:
```sh
certbot certonly --dns-cloudflare --dns-cloudflare-credentials ~/.secrets/cloudflare.ini \
-d frislit.example.com -d '*.frislit.example.com'
```
3. The nginx site below. WebSockets, unbuffered streaming and unlimited upload sizes are essential - tunnels carry
arbitrary apps and long-lived connections.
```nginx
server {
listen 80;
listen [::]:80;
server_name frislit.example.com *.frislit.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name frislit.example.com *.frislit.example.com;
ssl_certificate /etc/letsencrypt/live/frislit.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/frislit.example.com/privkey.pem;
# Tunnels carry anything, including huge uploads and streams
client_max_body_size 0;
proxy_buffering off;
proxy_request_buffering off;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
# WebSocket support (tunnelled apps and the CLI control channel)
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
# Long-lived connections
proxy_read_timeout 86400;
proxy_send_timeout 86400;
}
}
```
Add this once in the `http` block (usually `/etc/nginx/nginx.conf` or a file in `conf.d/`) so `Connection` is only
set to `upgrade` for real upgrade requests:
```nginx
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
```
Set `trustProxy: true` in the frislit config so the `X-Forwarded-*` headers above are used for the public host, the
`Secure` flag on session cookies and the client IP passed to your apps. It is off by default, because anyone who can
reach the port directly can otherwise put any address in `X-Forwarded-For` and walk through a tunnel's IP allowlist.
Only turn it on together with the tip below.
> [!TIP]
> Only nginx needs to reach frislit. Bind the container to `127.0.0.1:8080:8080` so port 8080 is not exposed to
> the internet without TLS.
+62
View File
@@ -0,0 +1,62 @@
# 🔁 Running as a service
`frislit start` runs every tunnel from one file and reconnects on its own. `frislit service install` makes it start
with your session.
## The file
`~/.config/frislit/tunnels.yml` on Linux, `~/Library/Application Support/frislit/tunnels.yml` on macOS,
`%APPDATA%\frislit\tunnels.yml` on Windows. Each key is the tunnel name:
```yaml
tunnels:
myapp:
http: 3000
site:
serve: /var/www/site
password: hunter2
shop:
http: 3000
routes:
/api: 4000
/docs: /var/www/docs
db:
tcp: 5432
allow: [ 10.0.0.0/8 ]
block: [ tor, vpn ]
```
| Key | Description |
|---------------------------------|----------------------------------------------------------------------------------------------------------------|
| `http` | A port, `host:port` or `https://host[:port]`. |
| `serve` | A directory to serve. |
| `tcp` | A port or `host:port`, shared with a code. |
| `routes` | Prefix to port, `host:port` or directory, see [Routing by path](/cli#routing-by-path). |
| `shape` | `latency`, `jitter`, `bandwidth`, `loss`, see [Simulating a bad connection](/cli#simulating-a-bad-connection). |
| `keep_host` | Send the public hostname as `Host` (HTTP only). |
| `allow` / `allow_countries` | Only these addresses or countries. |
| `block_ips` / `block_countries` | Never these addresses or countries. |
| `block` | `tor`, `vpn`, `datacenter`, `blocklist`. |
| `password` / `require_login` | Sign-in for visitors (HTTP only). |
Names should be [persistent](/persistent), otherwise they are free for anyone while the service is down.
```sh
frislit start # foreground, Ctrl+C stops everything
frislit start --config other.yml
```
## Installing
```sh
frislit service install
frislit service uninstall
```
| System | What it installs |
|---------|--------------------------------------------------------------------------------------------------------------------------|
| Linux | systemd user unit, `journalctl --user -u frislit -f` for logs. Linger is enabled so it also runs without a login session. |
| macOS | Launch agent, logs in `~/Library/Logs/frislit.log`. |
| Windows | Scheduled task that runs at logon. |
The device has to be linked (`frislit login`) first; the file is created with an example if it is missing.