### Install sing-box via winget (Windows) Source: https://sing-box.sagernet.org/installation/package-manager Installs sing-box on Windows using winget. ```bash winget install sing-box ``` -------------------------------- ### Start systemd service Source: https://sing-box.sagernet.org/installation/package-manager Starts the sing-box service. ```bash sudo systemctl start sing-box ``` -------------------------------- ### Install sing-box via pkg (FreeBSD) Source: https://sing-box.sagernet.org/installation/package-manager Installs sing-box on FreeBSD using pkg. ```bash pkg install sing-box ``` -------------------------------- ### Build and Install Source: https://sing-box.sagernet.org/installation/build-from-source Use this command to build the sing-box binary and install it to your Go binary directory. ```bash make install ``` -------------------------------- ### Install sing-box via Scoop (Windows) Source: https://sing-box.sagernet.org/installation/package-manager Installs sing-box on Windows using Scoop. ```bash scoop install sing-box ``` -------------------------------- ### Install sing-box via nixpkgs Source: https://sing-box.sagernet.org/installation/package-manager Installs sing-box on NixOS using nix-env. ```bash nix-env -iA nixos.sing-box ``` -------------------------------- ### Manual Installation Script Source: https://sing-box.sagernet.org/installation/package-manager Downloads and installs the latest sing-box package from GitHub releases using a script. ```bash curl -fsSL https://sing-box.app/install.sh | sh ``` -------------------------------- ### Manual Installation Script (Beta) Source: https://sing-box.sagernet.org/installation/package-manager Downloads and installs the latest beta version of sing-box from GitHub releases using a script. ```bash curl -fsSL https://sing-box.app/install.sh | sh -s -- --beta ``` -------------------------------- ### Install sing-box on Debian/APT Source: https://sing-box.sagernet.org/installation/package-manager Adds the sing-box repository and installs the package using APT. ```bash sudo mkdir -p /etc/apt/keyrings && sudo curl -fsSL https://sing-box.app/gpg.key -o /etc/apt/keyrings/sagernet.asc && sudo chmod a+r /etc/apt/keyrings/sagernet.asc && echo ' Types: deb URIs: https://deb.sagernet.org/ Suites: * Components: * Enabled: yes Signed-By: /etc/apt/keyrings/sagernet.asc ' | sudo tee /etc/apt/sources.list.d/sagernet.sources && sudo apt-get update && sudo apt-get install sing-box # or sing-box-beta ``` -------------------------------- ### Install sing-box via Chocolatey (Windows) Source: https://sing-box.sagernet.org/installation/package-manager Installs sing-box on Windows using Chocolatey. ```bash choco install sing-box ``` -------------------------------- ### Manual Installation Script (Specific Version) Source: https://sing-box.sagernet.org/installation/package-manager Downloads and installs a specific version of sing-box from GitHub releases using a script. ```bash curl -fsSL https://sing-box.app/install.sh | sh -s -- --version ``` -------------------------------- ### Install sing-box via APK (Alpine) Source: https://sing-box.sagernet.org/installation/package-manager Installs sing-box on Alpine Linux using apk. ```bash apk add sing-box ``` -------------------------------- ### Install sing-box via Homebrew (macOS/Linux) Source: https://sing-box.sagernet.org/installation/package-manager Installs sing-box on macOS or Linux using Homebrew. ```bash brew install sing-box ``` -------------------------------- ### Install with Homebrew Cask Source: https://sing-box.sagernet.org/clients/apple This command installs the sfm (Sing-box for macOS) client using Homebrew Cask. Ensure Homebrew is installed before running this command. ```bash # brew install sfm ``` -------------------------------- ### Install sing-box via APT (AOSC) Source: https://sing-box.sagernet.org/installation/package-manager Installs sing-box on AOSC using apt. ```bash apt install sing-box ``` -------------------------------- ### DNS Rules Configuration Example Source: https://sing-box.sagernet.org/migration Illustrates how to define DNS routing rules based on domains and client subnets. ```json { "domain": "google.com", "server": "google", "client_subnet": "1.1.1.1" } ``` -------------------------------- ### Install sing-box via pkg (Termux/Android) Source: https://sing-box.sagernet.org/installation/package-manager Installs sing-box on Android via Termux using pkg. ```bash pkg add sing-box ``` -------------------------------- ### CCM Server Configuration Example Source: https://sing-box.sagernet.org/configuration/service/ccm An example of a CCM service configuration for a server, demonstrating how to set listen ports, usage tracking paths, and authorized users with their tokens. ```json { "services": [ { "type": "ccm", "listen": "0.0.0.0", "listen_port": 8080, "usages_path": "./claude-usages.json", "users": [ { "name": "alice", "token": "ak-ccm-hello-world" }, { "name": "bob", "token": "ak-ccm-hello-bob" } ] } ] } ``` -------------------------------- ### Install sing-box on Redhat/DNF 5 Source: https://sing-box.sagernet.org/installation/package-manager Adds the sing-box repository and installs the package using DNF 5. ```bash sudo dnf config-manager addrepo --from-repofile=https://sing-box.app/sing-box.repo && sudo dnf install sing-box # or sing-box-beta ``` -------------------------------- ### Install sing-box via AUR Source: https://sing-box.sagernet.org/installation/package-manager Installs sing-box on Arch Linux using the AUR helper. ```bash ? -S sing-box ``` -------------------------------- ### Enable systemd service Source: https://sing-box.sagernet.org/installation/package-manager Enables the sing-box service to start on boot. ```bash sudo systemctl enable sing-box ``` -------------------------------- ### Install sing-box on Redhat/DNF 4 Source: https://sing-box.sagernet.org/installation/package-manager Adds the sing-box repository and installs the package using DNF 4. ```bash sudo dnf config-manager --add-repo https://sing-box.app/sing-box.repo && sudo dnf -y install dnf-plugins-core && sudo dnf install sing-box # or sing-box-beta ``` -------------------------------- ### Route Rule Structure Example Source: https://sing-box.sagernet.org/configuration/route/rule This is a comprehensive example demonstrating the structure of a route rule, including various matching conditions and their corresponding values. ```json { "route": { "rules": [ { "inbound": [ "mixed-in" ], "ip_version": 6, "network": [ "tcp" ], "auth_user": [ "usera", "userb" ], "protocol": [ "tls", "http", "quic" ], "client": [ "chromium", "safari", "firefox", "quic-go" ], "domain": [ "test.com" ], "domain_suffix": [ ".cn" ], "domain_keyword": [ "test" ], "domain_regex": [ "^stun\\..+" ], "geosite": [ "cn" ], "source_geoip": [ "private" ], "geoip": [ "cn" ], "source_ip_cidr": [ "10.0.0.0/24", "192.168.0.1" ], "source_ip_is_private": false, "ip_cidr": [ "10.0.0.0/24", "192.168.0.1" ], "ip_is_private": false, "source_port": [ 12345 ], "source_port_range": [ "1000:2000", ":3000", "4000:" ], "port": [ 80, 443 ], "port_range": [ "1000:2000", ":3000", "4000:" ], "process_name": [ "curl" ], "process_path": [ "/usr/bin/curl" ], "process_path_regex": [ "^/usr/bin/.+" ], "package_name": [ "com.termux" ], "package_name_regex": [ "^com\\.termux.*" ], "user": [ "sekai" ], "user_id": [ 1000 ], "clash_mode": "direct", "network_type": [ "wifi" ], "network_is_expensive": false, "network_is_constrained": false, "interface_address": { "en0": [ "2000::/3" ] }, "network_interface_address": { "wifi": [ "2000::/3" ] }, "default_interface_address": [ "2000::/3" ], "wifi_ssid": [ "My WIFI" ], "wifi_bssid": [ "00:00:00:00:00:00" ], "preferred_by": [ "tailscale", "wireguard" ], "source_mac_address": [ "00:11:22:33:44:55" ], "source_hostname": [ "my-device" ], "rule_set": [ "geoip-cn", "geosite-cn" ], "rule_set_ipcidr_match_source": false, "rule_set_ip_cidr_match_source": false, "invert": false, "action": "route", "outbound": "direct" }, { "type": "logical", "mode": "and", "rules": [], "invert": false, "action": "route", "outbound": "direct" } ] } } ``` -------------------------------- ### CCM Client Configuration Example Source: https://sing-box.sagernet.org/configuration/service/ccm Example client-side configuration for connecting to a CCM service. It involves setting environment variables for the base URL and authentication token, followed by invoking the 'claude' command. ```bash export ANTHROPIC_BASE_URL="http://127.0.0.1:8080" export ANTHROPIC_AUTH_TOKEN="ak-ccm-hello-world" claude ``` -------------------------------- ### DNS Rule Structure Example Source: https://sing-box.sagernet.org/configuration/dns/rule This is a comprehensive example of a DNS rule structure, illustrating various fields for matching and actions. Use this as a template for defining your own DNS rules. ```json { "dns": { "rules": [ { "inbound": [ "mixed-in" ], "ip_version": 6, "query_type": [ "A", "HTTPS", 32768 ], "network": "tcp", "auth_user": [ "usera", "userb" ], "protocol": [ "tls", "http", "quic" ], "domain": [ "test.com" ], "domain_suffix": [ ".cn" ], "domain_keyword": [ "test" ], "domain_regex": [ "^stun\\..+" ], "source_ip_cidr": [ "10.0.0.0/24", "192.168.0.1" ], "source_ip_is_private": false, "source_port": [ 12345 ], "source_port_range": [ "1000:2000", ":3000", "4000:" ], "port": [ 80, 443 ], "port_range": [ "1000:2000", ":3000", "4000:" ], "process_name": [ "curl" ], "process_path": [ "/usr/bin/curl" ], "process_path_regex": [ "^/usr/bin/.+" ], "package_name": [ "com.termux" ], "package_name_regex": [ "^com\\.termux.*" ], "user": [ "sekai" ], "user_id": [ 1000 ], "clash_mode": "direct", "network_type": [ "wifi" ], "network_is_expensive": false, "network_is_constrained": false, "interface_address": { "en0": [ "2000::/3" ] }, "network_interface_address": { "wifi": [ "2000::/3" ] }, "default_interface_address": [ "2000::/3" ], "source_mac_address": [ "00:11:22:33:44:55" ], "source_hostname": [ "my-device" ], "preferred_by": [ "local", "ts-dns" ], "wifi_ssid": [ "My WIFI" ], "wifi_bssid": [ "00:00:00:00:00:00" ], "rule_set": [ "geoip-cn", "geosite-cn" ], "rule_set_ip_cidr_match_source": false, "match_response": false, "ip_cidr": [ "10.0.0.0/24", "192.168.0.1" ], "ip_is_private": false, "ip_accept_any": false, "response_rcode": "", "response_answer": [], "response_ns": [], "response_extra": [], "invert": false, "outbound": [ "direct" ], "action": "route", "server": "local", "rule_set_ip_cidr_accept_empty": false, "rule_set_ipcidr_match_source": false, "geosite": [ "cn" ], "source_geoip": [ "private" ], "geoip": [ "cn" ] }, { "type": "logical", "mode": "and", "rules": [], "action": "route", "server": "local" } ] } } ``` -------------------------------- ### OCM Server Configuration Example Source: https://sing-box.sagernet.org/configuration/service/ocm A basic server configuration for the OCM service, specifying the listen address and port. ```json { "services": [ { "type": "ocm", "listen": "127.0.0.1", "listen_port": 8080 } ] } ``` -------------------------------- ### Inbound TLS Configuration Example Source: https://sing-box.sagernet.org/configuration/shared/tls Example JSON structure for configuring TLS settings in a sing-box inbound connection. This includes general TLS parameters, ACME for certificate management, and REALITY settings. ```json { "enabled": true, "server_name": "", "alpn": [], "min_version": "", "max_version": "", "cipher_suites": [], "curve_preferences": [], "certificate": [], "certificate_path": "", "client_authentication": "", "client_certificate": [], "client_certificate_path": [], "client_certificate_public_key_sha256": [], "key": [], "key_path": "", "kernel_tx": false, "kernel_rx": false, "handshake_timeout": "", "certificate_provider": "", "acme": { "domain": [], "data_directory": "", "default_server_name": "", "email": "", "provider": "", "disable_http_challenge": false, "disable_tls_alpn_challenge": false, "alternative_http_port": 0, "alternative_tls_port": 0, "external_account": { "key_id": "", "mac_key": "" }, "dns01_challenge": {} }, "ech": { "enabled": false, "key": [], "key_path": "", "pq_signature_schemes_enabled": false, "dynamic_record_sizing_disabled": false }, "reality": { "enabled": false, "handshake": { "server": "google.com", "server_port": 443, ... // Dial Fields }, "private_key": "UuMBgl7MXTPx9inmQp2UC7Jcnwc6XYbwDNebonM-FCc", "short_id": [ "0123456789abcdef" ], "max_time_difference": "1m" } } ``` -------------------------------- ### Outbound TLS Configuration Example Source: https://sing-box.sagernet.org/configuration/shared/tls Example JSON structure for configuring TLS settings in a sing-box outbound connection. This includes general TLS parameters, ECH, and REALITY settings for outbound traffic. ```json { "enabled": true, "engine": "", "disable_sni": false, "server_name": "", "insecure": false, "alpn": [], "min_version": "", "max_version": "", "cipher_suites": [], "curve_preferences": [], "certificate": "", "certificate_path": "", "certificate_public_key_sha256": [], "client_certificate": [], "client_certificate_path": "", "client_key": [], "client_key_path": "", "fragment": false, "fragment_fallback_delay": "", "record_fragment": false, "spoof": "", "spoof_method": "", "kernel_tx": false, "kernel_rx": false, "handshake_timeout": "", "ech": { "enabled": false, "config": [], "config_path": "", "query_server_name": "", "pq_signature_schemes_enabled": false, "dynamic_record_sizing_disabled": false }, "utls": { "enabled": false, "fingerprint": "" }, "reality": { "enabled": false, "public_key": "jNXHt1yRo0vDuchQlIP6Z0ZvjT3KtzVI-T4E7RoLJS0", "short_id": "0123456789abcdef" } } ``` -------------------------------- ### Basic TUN Configuration Structure Source: https://sing-box.sagernet.org/configuration/inbound/tun This is a comprehensive example of a TUN configuration object. It includes settings for interface name, IP addresses (IPv4 and IPv6), MTU, DNS hijacking, routing rules, and various platform-specific options. Use this as a template for setting up your TUN interface. ```json { "type": "tun", "tag": "tun-in", "interface_name": "tun0", "address": [ "172.18.0.1/30", "fdfe:dcba:9876::1/126" ], "mtu": 9000, "dns_mode": "hijack", "dns_address": [ "172.18.0.2", "fdfe:dcba:9876::2" ], "auto_route": true, "iproute2_table_index": 2022, "iproute2_rule_index": 9000, "auto_redirect": true, "auto_redirect_input_mark": "0x2023", "auto_redirect_output_mark": "0x2024", "auto_redirect_reset_mark": "0x2025", "auto_redirect_nfqueue": 100, "auto_redirect_iproute2_fallback_rule_index": 32768, "exclude_mptcp": false, "loopback_address": [ "10.7.0.1" ], "strict_route": true, "route_address": [ "0.0.0.0/1", "128.0.0.0/1", "::/1", "8000::/1" ], "route_exclude_address": [ "192.168.0.0/16", "fc00::/7" ], "route_address_set": [ "geoip-cloudflare" ], "route_exclude_address_set": [ "geoip-cn" ], "endpoint_independent_nat": false, "udp_timeout": "5m", "stack": "system", "include_interface": [ "lan0" ], "exclude_interface": [ "lan1" ], "include_uid": [ 0 ], "include_uid_range": [ "1000:99999" ], "exclude_uid": [ 1000 ], "exclude_uid_range": [ "1000:99999" ], "include_android_user": [ 0, 10 ], "include_package": [ "com.android.chrome" ], "exclude_package": [ "com.android.captiveportallogin" ], "include_mac_address": [ "00:11:22:33:44:55" ], "exclude_mac_address": [ "66:77:88:99:aa:bb" ], "platform": { "http_proxy": { "enabled": false, "server": "127.0.0.1", "server_port": 8080, "bypass_domain": [], "match_domain": [] } }, "gso": false, "inet4_address": [ "172.19.0.1/30" ], "inet6_address": [ "fdfe:dcba:9876::1/126" ], "inet4_route_address": [ "0.0.0.0/1", "128.0.0.0/1" ], "inet6_route_address": [ "::/1", "8000::/1" ], "inet4_route_exclude_address": [ "192.168.0.0/16" ], "inet6_route_exclude_address": [ "fc00::/7" ] } ``` -------------------------------- ### Headless Rule Structure Example Source: https://sing-box.sagernet.org/configuration/rule-set/headless-rule This snippet shows the comprehensive structure of a headless rule, demonstrating the various fields available for matching network traffic. It includes examples for query types, domains, IP addresses, ports, process information, package names, and network conditions. ```json { "rules": [ { "query_type": [ "A", "HTTPS", 32768 ], "network": [ "tcp" ], "domain": [ "test.com" ], "domain_suffix": [ ".cn" ], "domain_keyword": [ "test" ], "domain_regex": [ "^stun\\..+" ], "source_ip_cidr": [ "10.0.0.0/24", "192.168.0.1" ], "ip_cidr": [ "10.0.0.0/24", "192.168.0.1" ], "source_port": [ 12345 ], "source_port_range": [ "1000:2000", ":3000", "4000:" ], "port": [ 80, 443 ], "port_range": [ "1000:2000", ":3000", "4000:" ], "process_name": [ "curl" ], "process_path": [ "/usr/bin/curl" ], "process_path_regex": [ "^/usr/bin/.+" ], "package_name": [ "com.termux" ], "package_name_regex": [ "^com\\.termux.*" ], "network_type": [ "wifi" ], "network_is_expensive": false, "network_is_constrained": false, "network_interface_address": { "wifi": [ "2000::/3" ] }, "default_interface_address": [ "2000::/3" ], "wifi_ssid": [ "My WIFI" ], "wifi_bssid": [ "00:00:00:00:00:00" ], "invert": false }, { "type": "logical", "mode": "and", "rules": [], "invert": false } ] } ``` -------------------------------- ### OCM Client Configuration Example Source: https://sing-box.sagernet.org/configuration/service/ocm Client-side configuration for connecting to an OCM service using the codex CLI. It sets up a model provider and a profile pointing to the OCM proxy. ```toml # profile = "ocm" # set as default profile [model_providers.ocm] name = "OCM Proxy" base_url = "http://127.0.0.1:8080/v1" supports_websockets = true [profiles.ocm] model_provider = "ocm" # model = "gpt-5.4" # if the latest model is not yet publicly released # model_reasoning_effort = "xhigh" ``` -------------------------------- ### SSM API Server Mapping Example Source: https://sing-box.sagernet.org/configuration/service/ssm-api Example of how to map HTTP endpoints to Shadowsocks Inbound tags within the SSM API configuration. Ensure that the selected Shadowsocks inbounds are configured with 'managed' enabled. ```json { "servers": { "/": "ss-in" } } ``` -------------------------------- ### Advertise Routes Example Source: https://sing-box.sagernet.org/configuration/endpoint/tailscale Specify CIDR prefixes to advertise into the Tailscale network. This allows other nodes to reach networks through this node. ```json { "advertise_routes": ["192.168.1.1/24"] } ``` -------------------------------- ### Using Hosts with IP Accept Any Rule Source: https://sing-box.sagernet.org/configuration/dns/server/hosts An alternative DNS rule configuration that uses the 'hosts' server when 'ip_accept_any' is true. This example is relevant for sing-box versions prior to 1.14.0. ```json { "dns": { "servers": [ { "...": "..." }, { "type": "hosts", "tag": "hosts" } ], "rules": [ { "ip_accept_any": true, "server": "hosts" } ] } } ``` -------------------------------- ### Using Hosts for DNS Routing (sing-box 1.14.0+) Source: https://sing-box.sagernet.org/configuration/dns/server/hosts Example of configuring DNS rules to use the 'hosts' server for routing. This is applicable for sing-box versions 1.14.0 and later. ```json { "dns": { "servers": [ { "...": "..." }, { "type": "hosts", "tag": "hosts" } ], "rules": [ { "preferred_by": "hosts", "action": "route", "server": "hosts" } ] } } ``` -------------------------------- ### Advertise Tags Example Source: https://sing-box.sagernet.org/configuration/endpoint/tailscale Define tags for ACL enforcement. This is useful for granular access control within your Tailscale network. ```json { "advertise_tags": ["tag:server"] } ``` -------------------------------- ### Simple Build Source: https://sing-box.sagernet.org/installation/build-from-source Execute this command to perform a simple build of the sing-box application. ```bash make ``` -------------------------------- ### Custom Build using go build Source: https://sing-box.sagernet.org/installation/build-from-source Alternative method for custom builds using the `go build` command with tags. ```bash go build -tags "tag_a tag_b" ./cmd/sing-box ``` -------------------------------- ### Configuring Hosts File Paths Source: https://sing-box.sagernet.org/configuration/dns/server/hosts Specifies how to define a list of paths for custom hosts files. Defaults to system paths if not provided. ```json { "path": [ "/etc/hosts", "$HOME/.hosts" ] } ``` -------------------------------- ### Disable systemd service Source: https://sing-box.sagernet.org/installation/package-manager Disables the sing-box service from starting on boot. ```bash sudo systemctl disable sing-box ``` -------------------------------- ### Rule Set Structure Example Source: https://sing-box.sagernet.org/configuration/rule-set/source-format This is the basic JSON structure for a sing-box rule set. ```json { "version": 3, "rules": [] } ``` -------------------------------- ### Custom Build with Tags Source: https://sing-box.sagernet.org/installation/build-from-source Build sing-box with specific tags enabled. This is useful for enabling optional features. ```bash TAGS="tag_a tag_b" make ``` -------------------------------- ### Defining Predefined Hosts Source: https://sing-box.sagernet.org/configuration/dns/server/hosts Shows how to map hostnames to IP addresses directly within the configuration. Supports single IPs or arrays of IPs for hostnames. ```json { "predefined": { "www.google.com": "127.0.0.1", "localhost": [ "127.0.0.1", "::1" ] } } ``` -------------------------------- ### ShadowTLS Outbound Configuration Structure Source: https://sing-box.sagernet.org/configuration/outbound/shadowtls Example structure for configuring a ShadowTLS outbound connection. Ensure 'server', 'server_port', and 'tls' are properly defined. The 'password' field is only available for v2 and v3. ```json { "type": "shadowtls", "tag": "st-out", "server": "127.0.0.1", "server_port": 1080, "version": 3, "password": "fuck me till the daylight", "tls": {}, ... // Dial Fields } ``` -------------------------------- ### Migrate DNS Server with Strategy Source: https://sing-box.sagernet.org/migration Shows the migration of DNS server strategies from 'ipv4_only' and 'prefer_ipv6' applied directly to servers to being defined in rules or globally. ```json { "dns": { "servers": [ { "address": "1.1.1.1", "strategy": "ipv4_only" }, { "tag": "google", "address": "8.8.8.8", "strategy": "prefer_ipv6" } ], "rules": [ { "domain": "google.com", "server": "google" } ] } } ``` ```json { "dns": { "servers": [ { "type": "udp", "server": "1.1.1.1" }, { "type": "udp", "tag": "google", "server": "8.8.8.8" } ], "rules": [ { "domain": "google.com", "server": "google", "strategy": "prefer_ipv6" } ], "strategy": "ipv4_only" } } ``` -------------------------------- ### Clash API Configuration with CORS Enabled Source: https://sing-box.sagernet.org/configuration/experimental/clash-api Example configuration enabling CORS for the Clash API, allowing specific origins and private network access. This requires sing-box version 1.10.0 or later. ```json { "external_controller": "127.0.0.1:9090", "access_control_allow_origin": [ "http://127.0.0.1", "http://yacd.haishan.me" ], "access_control_allow_private_network": true } ``` -------------------------------- ### TCP Brutal Configuration Structure Source: https://sing-box.sagernet.org/configuration/shared/tcp-brutal This JSON structure enables TCP Brutal and sets the upload and download bandwidth limits in Mbps. Ensure the 'brutal' congestion control algorithm is installed on your Linux server. ```json { "enabled": true, "up_mbps": 100, "down_mbps": 100 } ``` -------------------------------- ### Hysteria 2 Server with ACME Source: https://sing-box.sagernet.org/manual/proxy-protocol/hysteria2 Server configuration using ACME for automatic certificate management. Replace 'example.org' and 'admin@example.org' with your domain and email. ```json { "inbounds": [ { "type": "hysteria2", "listen": "::", "listen_port": 8080, "up_mbps": 100, "down_mbps": 100, "users": [ { "name": "sekai", "password": "" } ], "tls": { "enabled": true, "server_name": "example.org", "acme": { "domain": "example.org", "email": "admin@example.org" } } } ] } ``` -------------------------------- ### Hysteria2 Inbound Configuration Structure Source: https://sing-box.sagernet.org/configuration/inbound/hysteria2 This is a comprehensive example of a Hysteria2 inbound configuration object. It includes settings for bandwidth, obfuscation, user authentication, TLS, QUIC, masquerading, BBR profiles, and Realm integration. ```json { "type": "hysteria2", "tag": "hy2-in", ... // Listen Fields "up_mbps": 100, "down_mbps": 100, "obfs": { "type": "salamander", "password": "cry_me_a_r1ver" }, "users": [ { "name": "tobyxdd", "password": "goofy_ahh_password" } ], "ignore_client_bandwidth": false, "tls": {}, ... // QUIC Fields "masquerade": "", // or {} "bbr_profile": "", "brutal_debug": false, "realm": { "server_url": "https://realm.example.com", "token": "", "realm_id": "", "stun_servers": [], "stun_domain_resolver": "", // or {} "http_client": {} } } ``` -------------------------------- ### Migrate DNS Server with Address Resolver Source: https://sing-box.sagernet.org/migration Shows the migration from using 'address_resolver' to a 'domain_resolver' with a separate tagged server configuration. ```json { "dns": { "servers": [ { "address": "https://dns.google/dns-query", "address_resolver": "google" }, { "tag": "google", "address": "1.1.1.1" } ] } } ``` ```json { "dns": { "servers": [ { "type": "https", "server": "dns.google", "domain_resolver": "google" }, { "type": "udp", "tag": "google", "server": "1.1.1.1" } ] } } ``` -------------------------------- ### View new systemd service logs Source: https://sing-box.sagernet.org/installation/package-manager Follows and displays new logs for the sing-box service in real-time. ```bash sudo journalctl -u sing-box --output cat -f ```