Skip to content

Settings

Source files: 12 · checked against muffin v0.3.0
  • muffin/crates/muffin-ipc/src/lib.rs
  • muffin/crates/muffin/src/prefs.rs
  • muffin/crates/muffin/src/pages/settings.rs
  • muffin/crates/muffin/src/pages/rules.rs
  • muffin/crates/muffin/src/shell_env.rs
  • muffin/crates/muffin/src/lan.rs
  • muffin/crates/muffin/src/sysproxy.rs
  • muffin/crates/muffin/src/desktop.rs
  • muffin/crates/muffin/src/main.rs
  • muffin/crates/muffin-service/src/daemon.rs
  • muffin/crates/muffin-service/src/geo.rs
  • muffin/crates/muffin-service/src/state.rs

You change Muffin’s settings in its window; Muffin saves them in two TOML files. This page lists every setting, where it appears and what it does.

File Kept by Holds
settings.toml The service Ports, LAN access, log level, mode, TUN and geodata
gui.toml The window Language, theme, system proxy, silent start, the sidebar’s speed, and the Proxies page’s pins, sort order and view

Both live in Muffin’s data directories, listed on Troubleshooting. A change made in the window is checked first: a change to the proxy is built into a kernel configuration and applied, and only saved once it runs. A change the kernel refuses leaves the running configuration and the file as they were.

You rarely need to edit the files: the window sets every key. If you do edit settings.toml, stop Muffin with Stop Proxy and Quit first, and start it again afterwards: the service reads the file when it starts and overwrites it at the next change. A file that does not parse is renamed to settings.toml.broken-<unix time>, and the defaults are used.

Settings sits at the bottom of the sidebar. Its panes are listed on the left:

Pane Setting Key
General Startup: Launch at login Not a key; see Launch at login
Startup: Start in the background gui.toml silent_start
Language: System, English or 简体中文 gui.toml language
Appearance Theme: Light, Dark or System gui.toml theme_mode
Layout: Show traffic in the sidebar gui.toml hide_sidebar_speed, inverted
Network System Proxy gui.toml system_proxy; see System proxy
Ports: HTTP port, SOCKS port, changed with Edit… http_port, socks_port
Local network: Allow LAN allow_lan; see Local network
Terminal: Shell and Copy See Proxy environment
TUN Permission: Privileged helper, Grant Permission… or Revoke See TUN mode
TUN mode [tun] enabled
Device: Name, MTU and Bootstrap DNS, changed with Edit…, and IPv6 [tun] device, mtu, bootstrap_dns, ipv6
Advanced: Stack, Excluded routes, DNS hijack None: marked Needs engine, and not available in 0.3.0
Data Geo data: GeoIP and GeoSite URLs, changed with Edit… [geo] geoip_url, geosite_url
Geo data: GeoIP and GeoSite, Update Now See Geodata
Files: Data folder, Open Opens the service’s data directory; the row shows its path
Files: Runtime Config, Open Opens runtime/config.toml, the kernel configuration Muffin last applied, read-only
Advanced Kernel: Log level: Debug, Info, Warn or Error log_level
Kernel: Etemenanki kernel, Restart Kernel Restarts the kernel with the current configuration; open connections are closed. The row shows the kernel’s error when it failed.
Quit: Stop Proxy and Quit Turns the system proxy off, stops the service and quits
About The versions of Muffin and of the service, Copy Version Info, Report a Problem… Report a Problem… opens Diagnostics

The mode key is switched on the Overview, on the Proxies page or in the tray menu. Until you grant the TUN permission, the TUN mode switch is disabled. The System Proxy and TUN Mode switches are also on the Overview and in the tray menu.

The Edit… dialogs check their values before saving:

Message Cause
Ports must be between 1 and 65535 A port that is empty or out of range
The HTTP and SOCKS ports must differ The same port twice
The device name can’t be empty An empty TUN device name
MTU must be between 1280 and 9000 An MTU out of range
Bootstrap DNS must be an IP address and port, e.g. 223.5.5.5:53 A Bootstrap DNS that is not IP:port, such as a host name or an address without a port
Geo data links must start with http:// or https:// A geodata URL of another scheme
KeyTypeRequiredDefaultDescription
http_portu16no7890Port of the local HTTP proxy (Settings › Network › Ports). Must differ from socks_port (http_port and socks_port must differ) and lie between 1 and 65535.
socks_portu16no7891Port of the local SOCKS5 proxy, which also relays UDP.
allow_lanboolnofalseAllow LAN: both proxies listen on 0.0.0.0 instead of 127.0.0.1, so other devices on your network can use them. Neither proxy asks for a password.
log_levelstring (enum)no"info"debug, info, warn or error: what the Logs page and the service log show. The RUST_LOG environment variable of the service, when set, takes precedence.
modestring (enum)no"rule"rule follows the profile's route groups and your picks; global sends everything to the default pick, or the first node; direct sends everything direct.
tuntableno{}TUN mode, written as [tun]. See the TUN table below.
geotableno{}Where geodata is downloaded from, written as [geo]. See the geodata table below.
KeyTypeRequiredDefaultDescription
enabledboolnofalseTUN mode: route the whole system through Muffin. Needs the TUN permission first (TUN needs the permission to create a network device; grant it in Settings).
devicestringno"muffin0"Name of the interface (Device Name). On macOS the system names the device utun<N> unless this value is itself utun<N>.
mtuu16no1500MTU of the interface, from 1280 to 9000 (MTU must be between 1280 and 9000).
bootstrap_dnsstringno"223.5.5.5:53"Bootstrap DNS: an IP address and port. With TUN on, the proxy resolves the names of servers and destinations through this server over UDP, outside the tunnel.
ipv6boolnofalseRelay IPv6 through the TUN. Off, IPv6 is still routed into the TUN, where its connections are refused, so applications use IPv4 at once and no IPv6 traffic bypasses Muffin.
KeyTypeRequiredDefaultDescription
geoip_urlstringno"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat"Where geoip.dat is downloaded from (Settings › Data › Geo data). The window accepts only http and https URLs.
geosite_urlstringno"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat"Where geosite.dat is downloaded from (Settings › Data › Geo data). The window accepts only http and https URLs.
KeyTypeRequiredDefaultDescription
languagestring (enum)no"system"system, en or zh-CN (Language).
theme_modestring (enum)no"system"system, light or dark (Theme).
system_proxyboolnofalseSet the system proxy to Muffin while the proxy runs (System Proxy).
silent_startboolnofalseStart in the tray, without opening the window (Start in the background). Without a tray, the window opens anyway.
pinned_nodesarray of stringsno[]Names of the nodes pinned to the top of the Proxies page, in the order they were pinned, for every profile.
node_viewstring (enum)no"grid"grid or list: how the Proxies page lays out nodes.
node_sortstring (enum)no"profile"profile, latency or name: how the Proxies page orders nodes (profile order, fastest first, or by name).
hide_sidebar_speedboolnofalseLeave the download and upload speed out of the sidebar (the opposite of Show traffic in the sidebar).

With System Proxy on, Muffin points the system’s proxy settings at its own proxies while the proxy runs, and clears them when the proxy stops.

Desktop What Muffin sets Not proxied
GNOME, Unity, Cinnamon, Budgie, MATE The GNOME proxy settings, through gsettings localhost, 127.0.0.0/8, ::1
KDE Plasma KDE’s proxy settings, through kwriteconfig6 or kwriteconfig5 localhost, 127.0.0.0/8, ::1
macOS The web, secure web and SOCKS proxies of every enabled network service, through networksetup localhost, 127.0.0.0/8, ::1, *.local, 169.254/16
Windows Your user’s WinINet proxy, pointed at the HTTP port, which most programs follow localhost, 127.*, 10.*, 172.16.* to 172.31.*, 192.168.* and local names

The switch keeps your choice, and the Overview shows whether the system proxy is set right now: System Proxy Off: Kernel Not Running while the switch is on but the kernel does not run. On other Linux desktops the switch is disabled, with System proxy is not supported on this desktop; use TUN mode or the proxy environment instead.

Allow LAN makes both proxies listen on 0.0.0.0 instead of 127.0.0.1, so other devices on your network can use them. While it is on, the pane shows Address for other devices: this computer’s private IPv4 address with the HTTP and SOCKS ports, or No local network address found when the route to the internet does not leave through a private address. Neither proxy asks for a password, so anyone on the network can use them. The Overview’s Allow LAN switch does the same.

Settings › Network › Terminal shows the command that points terminal programs at Muffin, with the current ports, in the syntax of the shell you pick. Muffin preselects PowerShell on Windows, and elsewhere the shell named by $SHELL (zsh or fish), else bash. Copy copies the command.

Shell Command
bash, zsh export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7891
fish set -gx https_proxy http://127.0.0.1:7890; set -gx http_proxy http://127.0.0.1:7890; set -gx all_proxy socks5://127.0.0.1:7891
PowerShell $env:https_proxy="http://127.0.0.1:7890"; $env:http_proxy="http://127.0.0.1:7890"; $env:all_proxy="socks5://127.0.0.1:7891"
cmd set https_proxy=http://127.0.0.1:7890&& set http_proxy=http://127.0.0.1:7890&& set all_proxy=socks5://127.0.0.1:7891

The variables last for the shell session they are set in.

Launch at login and start in the background

Section titled “Launch at login and start in the background”

Launch at login starts Muffin when you log in. It is on while Muffin’s autostart entry exists: an XDG autostart entry on Linux, a launch agent in ~/Library/LaunchAgents on macOS, or a Run value under your user’s registry key on Windows. The entry starts Muffin with --silent, in the tray. Start in the background does the same for every start. The Overview’s footer also switches Launch at login.

A silent start opens the window after all when there is no tray to show, such as on a Linux desktop without a StatusNotifierItem host.

Route groups that match by geoip or geosite need the v2ray-format geodata files. In Rule mode, Muffin downloads the file a profile needs when it is missing, from the URLs in [geo], directly rather than through a node. Update Now, in Settings › Data or on the Rules page, downloads both files again and keeps the old ones unless both downloads succeed; the running kernel then uses the new files. Both places show when the files were last updated, or Never updated (Never downloaded on the Rules page).

Change the URLs in Settings › Data › Geo data › Edit…. The new URLs are used for the next download, so click Update Now to fetch from them at once.