Skip to content

Muffin

Source files: 12 · checked against muffin v0.3.0
  • muffin/README.md
  • muffin/crates/muffin/src/main.rs
  • muffin/crates/muffin/src/tray.rs
  • muffin/crates/muffin/src/shell.rs
  • muffin/crates/muffin/src/widgets/sidebar.rs
  • muffin/crates/muffin/src/summary.rs
  • muffin/crates/muffin/src/pages/overview.rs
  • muffin/crates/muffin/src/pages/placeholder.rs
  • muffin/crates/muffin-service/src/daemon.rs
  • muffin/crates/muffin-service/src/kernel.rs
  • muffin/crates/muffin-service/src/render.rs
  • muffin/crates/muffin-service/src/probe.rs

Muffin is a desktop proxy client for Linux, macOS and Windows built on the Etemenanki kernel, the same kernel etemenanki-app runs. You import a subscription from your provider, pick a node, and turn on the system proxy or TUN mode; Muffin keeps the kernel running in a background service and gives you a window and a tray icon to control it.

This page explains how Muffin is put together and what it can do. The next pages cover installing it, a first connection, profiles, TUN mode, settings and troubleshooting. It describes Muffin 0.3.0, which embeds etemenanki-app 2.6.0.

Muffin is two programs:

  • muffin, the window and the tray icon. It shows the state of the connection, your profiles and nodes, connections, rules, logs and diagnostics, and sends your changes to the service.
  • muffin-service, a background service that owns your settings and profiles, downloads geodata, and runs the Etemenanki kernel. It serves a small HTTP API on a local socket that only your user can open.
flowchart LR
  W["muffin: window and tray"] -- "local socket" --> S["muffin-service"]
  S --> K["Etemenanki kernel"]
  A["Applications"] -- "system proxy, or TUN" --> K
  K --> N["Proxy server from the profile"]
  S -- "subscription URL" --> P["Provider"]

The window starts the service through the platform’s service manager when it opens: a systemd user unit on Linux, a launchd agent on macOS and a background process on Windows. With the TUN permission, a privileged copy of the service runs instead, because creating a network interface needs administrator rights.

The kernel serves two local proxies, HTTP on 127.0.0.1:7890 and SOCKS5 on 127.0.0.1:7891 by default, and, in TUN mode, a network interface that captures the whole system’s traffic. Every change you make, a new node, a new mode or a new port, is built into a kernel configuration, checked by the kernel and applied; if the kernel refuses it, the running configuration stays and Muffin shows the error.

Platform Package Requirements
Linux, x86-64 and ARM64 .deb, .rpm, or a .tar.gz glibc 2.34 or later and OpenSSL 3; a desktop with a StatusNotifierItem tray for the tray icon
macOS, Apple silicon .dmg macOS 11 or later
Windows, x86-64 Setup program Windows 10 or later

Install covers each package.

The sidebar on the left starts with a status card, and clicking it opens the Overview. The card shows:

  • the state: Connected, Not capturing (the kernel runs, but neither the system proxy nor TUN mode sends it traffic), Starting…, Kernel stopped or Service unavailable, and how long the kernel has run;
  • the node the Default route uses, with its protocol and latency, or Direct, Reject or No node;
  • the mode, and how traffic reaches Muffin: Off, System Proxy, TUN Mode or System Proxy + TUN.

Below it are the pages, with an Activity group for what Muffin observes. The download and upload speed sit above Settings at the bottom, unless you hide them in Settings › Appearance.

Page What it is for
Overview The connection at a glance; see below
Proxies The route groups and their nodes: pick a node for each group, test latencies, filter by region, pin nodes. See Picks.
Profiles Import, update, edit and switch subscriptions. See Profiles.
Overrides Not built in 0.3.0: the page says Not built yet.
Connections Every open connection, with its group, node and traffic. The sidebar shows how many are open. See Connections.
Traffic Not built in 0.3.0.
Rules The active profile’s rules in the order they match, and the geodata they read. See Rules.
Logs The service’s log. The sidebar counts the warnings and errors of the last hour. See Logs.
Diagnostics The connection doctor, the exit address, the reachability of common sites, and the diagnostic bundle. See Diagnostics.
Settings Seven panes: General, Appearance, Network, TUN, Data, Advanced and About. See Settings.
Part What it shows and does
Header The active profile, which opens Profiles, and a button that tests the latency of every node
Status The state and uptime, and a Rule, Global, Direct switch for the mode
Current node The node the Default route uses, its protocol and latency, Test, and Switch Node, which opens Proxies. In Direct mode it says Direct.
Exit IP, Location, Network The address websites see through Muffin, its city and country, and its network (AS number and organisation)
Listening The HTTP and SOCKS ports
Switches System Proxy, TUN Mode and Allow LAN; see How applications reach Muffin
Traffic The download and upload speed over the last 60 seconds, this session’s totals, and the number of connections, which opens Connections
Route groups Default and the first four of the profile’s groups that follow another route or have a pick, with what each one uses now. Show all opens Proxies.
Reachability How fast eight common sites answer through Muffin
Profile The active profile: where it comes from, when it was updated, the traffic used and the renewal date when the provider sends them, an Update button, and the automatic update schedule. Manage opens Profiles.
Footer The kernel’s state, the service’s version and whether it runs as User Mode or Privileged Mode (with the TUN permission), Muffin’s version, the operating system, Launch at login: On or Off (click to switch it), and Restart Kernel

Muffin looks the exit address up at ipinfo.io, through its own proxy, when the Overview opens and when the Default route moves to another node. The exit address and reachability checks run only while the kernel runs. When the kernel does not run, the status area says Kernel stopped, with the kernel’s error, and offers Restart Kernel.

The mode decides where traffic goes. Switch it on the Overview, at the top of the Proxies page or in the tray menu.

Mode Traffic goes
Rule By the profile’s route groups: each group to the node you picked for it, and what no group matches to the default node
Global All of it to the default node, or to the first node when nothing is picked
Direct All of it straight out, without a proxy

Without a profile, Muffin still runs the kernel, and everything goes direct.

Way What it covers How to turn it on
System proxy Applications that honour the system’s proxy settings, such as browsers The System Proxy switch on the Overview, in Settings › Network or in the tray
TUN mode Every application, including those that ignore proxy settings Grant the TUN permission once, then switch TUN Mode on
Proxy environment Terminal programs that read http_proxy and all_proxy Settings › Network › Terminal: pick your shell, Copy, and paste into the shell
Manual Any application with its own proxy setting Point it at 127.0.0.1:7890 (HTTP) or 127.0.0.1:7891 (SOCKS5)

On the Overview, the System Proxy switch says On · 127.0.0.1:7890 while the system proxy is set, and System Proxy Off: Kernel Not Running while the switch is on but the kernel does not run. Allow LAN opens both proxies to other devices on your network; see Settings.

Closing the window keeps Muffin in the tray. The tray menu has two ways out:

  • Quit Muffin closes the window and the tray icon. The service and the proxy keep running, so applications stay connected.
  • Stop Proxy and Quit turns the system proxy off, stops the service and the kernel, and closes Muffin. The System Proxy setting is kept for the next start. Settings › Advanced has the same button.

Opening Muffin again reconnects to the running service, or starts it.