Skip to content

Profiles

Source files: 11 · checked against muffin v0.3.0
  • muffin/crates/muffin-service/src/profiles.rs
  • muffin/crates/muffin-service/src/convert.rs
  • muffin/crates/muffin-service/src/state.rs
  • muffin/crates/muffin-service/src/render.rs
  • muffin/crates/muffin-service/src/routing.rs
  • muffin/crates/muffin-ipc/src/headers.rs
  • muffin/crates/muffin/src/pages/profiles.rs
  • muffin/crates/muffin/src/pages/proxies.rs
  • muffin/crates/muffin/src/widgets/request_headers.rs
  • muffin/crates/muffin/src/region.rs
  • muffin/crates/muffin/src/summary.rs

A profile is one subscription: a subscribe file with the provider’s nodes, route groups and DNS setup, plus what Muffin keeps beside it, such as where it came from, the request headers it is fetched with, and which node you picked for each group. This page covers adding, updating, editing and switching profiles, and picking nodes on the Proxies page.

Muffin keeps every profile as an Etemenanki subscribe file, in TOML. A subscription URL may answer with such a file, or with a subscription in another client’s format, which Muffin converts into a subscribe file when it imports or updates the profile:

Format Recognised by
Clash (mihomo) profile A YAML file with a proxies: list
sing-box profile JSON
Share links One link per line, such as vless://… or trojan://…, as plain text or as one base64 block
Surge or Surfboard A [Proxy] section
Loon or Quantumult X name = type, … lines

Muffin tries every format the answer looks like and keeps the conversion that writes the most nodes. A file you import from disk is not converted: Import File and dropping a file take subscribe files only.

Before saving a profile, Muffin builds it into a kernel configuration in Rule mode and checks it the way a start would, so a file the kernel cannot run is refused at import, with the kernel’s message.

Muffin runs these nodes from a subscription:

Protocol Shown on the Proxies page as
VLESS, over TCP, WebSocket or gRPC, with or without TLS VLESS, with the transport and TLS
VLESS over REALITY, optionally with the XTLS Vision flow (xtls-rprx-vision) VLESS, transport REALITY, TLS; the SNI is the site the server fronts
VMess, Trojan, Shadowsocks, SOCKS and HTTP The protocol, with the transport and TLS when it is on
AnyTLS AnyTLS, transport TCP, TLS
Hysteria 2 Hysteria 2, transport QUIC, TLS
WireGuard WireGuard, transport UDP

Muffin has no form for entering a node by hand, so every node, including AnyTLS, VLESS+REALITY and Vision nodes, comes from a subscription. A provider that decides by the client which node types to serve recognises Muffin by its default User-Agent; a profile with its own User-Agent may get a different set.

Hysteria 2 nodes may carry port hopping and rates: ports, hop_interval, up and down, as described in Subscribe files.

A conversion takes only the provider’s nodes:

  • The route groups and the [dns] table come from a built-in template, not from the subscription’s own groups and rules. The template drops ads, sends local networks, Chinese sites, Apple and Microsoft direct, and gives services such as Google, YouTube, Netflix, Telegram and AI tools a group each, which follows Default until you pick a node for it.
  • These groups match by geosite and geoip codes, so Muffin downloads the geodata files before it runs such a profile in Rule mode.
  • A node the kernel cannot run, such as one of a protocol it does not support, is left out, and the service log names it and says why: proxy "<name>" left out: …. Shadowsocks nodes are kept and carry TCP only, as Shadowsocks always does in Etemenanki.
  • A subscription of which no node can be written is refused with converting the subscription: ….

The Profiles page starts with the import panel.

From How Its name
A URL Paste the link into Profile URL and click Import From the provider’s answer, see below, or else the URL’s host
The clipboard When the page opens with an http or https link on the clipboard that no profile uses yet, a banner offers it: Import, or dismiss it with the close button As for a URL
Subscribe files Import File, which takes several files at once, or drop the files anywhere on the page The file name without its extension

The first profile becomes the active one. Import more profiles to switch between providers or plans; only the active one runs.

Some providers choose the format of their answer by the User-Agent, and some want extra headers, such as a token. Each profile from a URL can carry its own:

  • User-Agent replaces Muffin’s own. Left empty, Muffin sends its own, which starts with Muffin <version>.
  • Extra headers are sent after it, one Name: value per line, in order. Blank lines are skipped, and the same name may appear twice.

Set them under Request headers in the import panel before you click Import, or later in Edit Info. Muffin sends them with every fetch of that subscription: the import, Update, Update via Proxy and automatic updates. A profile imported from a file has none.

Muffin checks the fields as you type and again before it sends anything:

Message Cause
Line <n> has no colon (Name: value) An extra header without a colon
"<name>" is not a valid header name A name with a space or another character HTTP does not allow in one, or an empty name
<name> cannot be set as an extra header Host, Content-Length, Connection or Transfer-Encoding, which the HTTP client sets itself
Set the User-Agent in its own field User-Agent as an extra header
The value of <name> has a line break or another control character A value, or the User-Agent, with a control character

The profile’s details show the User-Agent, or Muffin (default), and how many extra headers it has, not their values. Headers may hold a token, so Muffin never writes them to its logs or error messages, and the diagnostic bundle says only that a profile has custom request headers. They are stored in profiles.toml, readable by your user only.

Muffin fetches the URL directly, not through its proxies (in TUN mode the system still routes the fetch into the TUN interface, like any other program’s connection):

  • Only http and https URLs are accepted (invalid URL: only http and https are supported), at import and in Edit Info.
  • The request has 30 seconds to finish, and the file may be at most 10 MiB (the subscription is larger than 10 MiB).
  • It carries the profile’s request headers.

Muffin reads three headers of the answer, as other clients do:

Header Used for
Content-Disposition The profile’s name: filename*, else filename, without its extension
subscription-userinfo Traffic and the renewal date: upload, download, total and expire (a Unix time; 0 means none)
profile-update-interval The update interval, in hours

A subscription URL usually holds a token that gives access to your account. Muffin keeps the full URL in its profile list, but every log line and error message shows only its scheme, host and port, and the profile’s details show only its scheme and host, with the rest masked. The copy button next to it copies the full link.

Below the import panel, each profile has a card: its name, Active on the one in use, the host it comes from (or Local file) and when it was updated, and the traffic used of the plan’s total (∞ without a limit), with a bar when the plan has a limit, and the renewal date. A card whose last update failed says Update failed.

Click a card to see its details:

Part What it shows
Actions Use This Profile (on an inactive profile), Update and, behind the arrow next to it, Update via Proxy, Edit Info, and under More (…) Open File and Delete
Usage The traffic used, of how much, and how much is left; No limit when the plan has none, Not reported by the provider without subscription-userinfo
Renews The expiry date and the days left, or No expiry date
Nodes The number of nodes, counted for the profile in use only
Auto-update Every <n> h, Off, or Never for a profile from a file, and how long ago it was updated
Source The masked subscription URL, the User-Agent and the extra headers; Local for a file

A failed update shows its error above the tiles until the next successful update.

Muffin updates a profile from its URL on its own once its update interval has passed. The interval is the provider’s profile-update-interval, or 24 hours; Edit Info changes it, in whole hours, and 0 turns automatic updates off. The service checks every 10 minutes which profiles are due.

You can also update by hand:

Button What it does
Update Fetches this profile now, directly. The Overview’s Profile card has the same button for the active profile.
Update via Proxy Fetches it through Muffin’s own HTTP proxy, for a provider that is only reachable through a node. It is available only while the kernel runs.
Update All Profiles Fetches every profile that has a URL

A converted subscription is converted again at every update. An updated active profile is applied at once; connections the update does not affect keep going. A failed update keeps the old file, and the profile shows the error.

Button What it does
Edit Info Changes the name, the URL, the update interval and the request headers. An interval that is not a whole number is refused with Update interval must be a whole number of hours.
Open File Opens the profile’s subscribe file in your editor. After editing it, choose Reactivate Profile in the page’s More menu (…, at the top) to apply it as it is on disk.
Runtime Config In the page’s More menu: opens the kernel configuration Muffin last applied, built from the profile and your settings, for reference
Delete Removes the profile, after asking. The active profile cannot be deleted (Cannot delete the active profile): use another one first.

A profile updated from its URL replaces the file, so edits you made in Open File are lost at the next update.

The Proxies page has three columns: the route groups, the choices of the selected group, and details of what that group uses now.

  • Route groups. Default comes first and carries what no rule sends elsewhere. In Rule mode the profile’s groups follow, each with a caption: Picked by you, Same as Default, Same as <group>, Direct unless you pick or Blocked unless you pick. In Global and Direct mode only Default is listed.
  • Choices. Click a node to make it the group’s pick. The list also offers Direct and Reject when the profile has those routes, and, for every group but Default, the group’s own fallback, marked Automatic, which clears the pick. Filter the nodes by region, read from their names (Hong Kong, Japan, Singapore, United States, Taiwan, Korea, United Kingdom, Germany, Others), search them by name, sort them by profile order, latency or name, and show them as a grid or a list. Pinned nodes come first, under Pinned.
  • Details. The node the group uses: its protocol, transport and TLS, In use for <group>, the TCP latency, the server and port, the SNI, and the region. Test Latency, Pin or Unpin, and Copy Address, which copies server:port. Real delay, Speed and Dial through are marked Needs engine: Muffin 0.3.0 does not have them. The column is left out when the window is narrow.

Latency is the time a node takes to accept a TCP connection. Click a node’s latency to test it again, or Test All to test every node. Hysteria 2 and WireGuard nodes show UDP and are not measured.

Muffin keeps the picks per profile, so switching profiles and back restores them. A group without a pick follows what the subscribe file says it inherits, and Default without a pick goes to the profile’s first node, or direct when the profile has no node. A pick that names a node an update removed is ignored in the same way. Pins, the sort order and the view are kept in gui.toml, by node name, across profiles.

In Global mode, the route groups are left out and everything goes to the Default pick, or to the first node. In Direct mode everything goes direct, and the page says that the picks take effect when you switch back.