{
  "report_info": {
    "version": "9.0.1",
    "generated_at": "2026-04-11T17:16:15Z",
    "binary_name": "routing-switch"
  },
  "binary": {
    "name": "routing-switch",
    "path": "/home/kodachi/k900/dashboard/hooks/routing-switch",
    "timestamp": "2026-04-11T17:16:15Z",
    "file_info": {
      "size": 8353184,
      "sha256": "c135302e12d103fdfec77c1f29d8c835c522b575013d64e441aa6d9e03b5472b"
    },
    "flag_n": {
      "command": "info",
      "data": {
        "author": "Warith Al Maawali",
        "configuration": "Uses online-auth get-card for paid VPN credentials; VPNGate servers are free and require no authentication",
        "connection_limit": "One active connection at a time",
        "copyright": "© 2026 Linux Kodachi",
        "description": "System-wide traffic routing through various proxy protocols",
        "features": [
          "System-wide traffic routing through proxy protocols",
          "Support for OpenVPN, WireGuard, and Dante SOCKS5",
          "Support for Tor, Shadowsocks, V2Ray, and Xray protocols",
          "Support for Mieru/Mita and Hysteria2 protocols",
          "Automatic protocol scoring and selection",
          "DNS leak prevention with multiple modes",
          "Metric-based and direct routing options",
          "External configuration file support",
          "IPv4/IPv6 dual-stack support",
          "QR code generation for mobile clients",
          "VPNGate free VPN integration (100+ public servers, no auth required)",
          "Comprehensive logging and monitoring"
        ],
        "license": "Proprietary",
        "name": "routing-switch",
        "security_features": [
          "Input validation: All inputs are validated and sanitized",
          "Rate limiting: Built-in rate limiting for network operations",
          "Authentication: Secure authentication with certificate pinning",
          "Encryption: TLS 1.3 for all network communications",
          "Kill switch: Direct routing mode prevents leaks on failure",
          "DNS protection: Multiple DNS modes to prevent leaks"
        ],
        "state_file": "./results/routing-switch-state.json",
        "supported_protocols": [
          "OpenVPN",
          "WireGuard",
          "Dante",
          "Tor",
          "Shadowsocks",
          "V2Ray",
          "Xray-VLESS",
          "Xray-VLESS-Reality",
          "Xray-Trojan",
          "Xray-VMess",
          "Mita/Mieru",
          "Hysteria2",
          "VPNGate (free public servers)"
        ],
        "system_requirements": {
          "dependencies": "OpenSSL, libcurl, tun2socks (for most protocols), redsocks (for Tor)",
          "os": "Linux (Debian-based)",
          "privileges": "root/sudo for system operations"
        },
        "version": "9.0.1",
        "website": "https://digi77.com"
      },
      "errors": [],
      "metadata": {
        "executionTime": 1,
        "hostname": "Boardroom-System",
        "user": "kodachi"
      },
      "status": "success",
      "timestamp": "2026-04-11T17:16:15.672666529Z",
      "version": "9.0.1",
      "warnings": []
    },
    "flag_v": {
      "command": "version",
      "data": {
        "buildDate": "2026-04-11T17:16:15.801440853Z",
        "gitCommit": "unknown",
        "name": "routing-switch",
        "rustVersion": "1.70.0",
        "version": "9.0.1"
      },
      "errors": [],
      "metadata": {
        "executionTime": 2,
        "hostname": "Boardroom-System",
        "user": "kodachi"
      },
      "status": "success",
      "timestamp": "2026-04-11T17:16:15.801451514Z",
      "version": "9.0.1",
      "warnings": []
    },
    "flag_h": {
      "command": "help",
      "data": {
        "commandCategories": [
          {
            "category": "CONNECTION COMMANDS",
            "commands": [
              {
                "description": "Connect to a proxy protocol (openvpn, wireguard use native routing; tor uses redsocks; dante, shadowsocks, v2ray, xray-*, mita use tun2socks)",
                "name": "connect",
                "options": [],
                "requires_sudo": true,
                "usage": "routing-switch connect <PROTOCOL> [OPTIONS]"
              },
              {
                "description": "Disconnect current proxy connection",
                "name": "disconnect",
                "options": [],
                "requires_sudo": true,
                "usage": "routing-switch disconnect [OPTIONS]"
              },
              {
                "description": "Show current connection status",
                "name": "status",
                "options": [],
                "requires_sudo": false,
                "usage": "routing-switch status [OPTIONS]"
              }
            ]
          },
          {
            "category": "INFORMATION COMMANDS",
            "commands": [
              {
                "description": "Display current DNS server information",
                "name": "dns-info",
                "options": [],
                "requires_sudo": false,
                "usage": "routing-switch dns-info [OPTIONS]"
              },
              {
                "description": "List available protocols with scores",
                "name": "list-protocols",
                "options": [],
                "requires_sudo": false,
                "usage": "routing-switch list-protocols [OPTIONS]"
              }
            ]
          },
          {
            "category": "TESTING COMMANDS",
            "commands": [
              {
                "description": "Test a specific protocol connectivity",
                "name": "test-protocol",
                "options": [],
                "requires_sudo": false,
                "usage": "routing-switch test-protocol <PROTOCOL> [OPTIONS]"
              },
              {
                "description": "Benchmark all available protocols",
                "name": "benchmark",
                "options": [],
                "requires_sudo": false,
                "usage": "routing-switch benchmark [OPTIONS]"
              }
            ]
          },
          {
            "category": "CONFIGURATION COMMANDS",
            "commands": [
              {
                "description": "Export protocol configurations to files",
                "name": "export-config",
                "options": [],
                "requires_sudo": false,
                "usage": "routing-switch export-config [PROTOCOL] [OPTIONS]"
              },
              {
                "description": "Show protocol configuration",
                "name": "showconfig",
                "options": [],
                "requires_sudo": false,
                "usage": "routing-switch showconfig [PROTOCOL] [OPTIONS]"
              },
              {
                "description": "Show protocol configuration as URL",
                "name": "showconfigurl",
                "options": [],
                "requires_sudo": false,
                "usage": "routing-switch showconfigurl [PROTOCOL] [OPTIONS]"
              },
              {
                "description": "Show protocol configuration as QR code",
                "name": "showconfigqr",
                "options": [],
                "requires_sudo": false,
                "usage": "routing-switch showconfigqr [PROTOCOL] [OPTIONS]"
              }
            ]
          },
          {
            "category": "MANAGEMENT COMMANDS",
            "commands": [
              {
                "description": "Auto-select and connect to best protocol",
                "name": "auto-select",
                "options": [],
                "requires_sudo": true,
                "usage": "routing-switch auto-select [OPTIONS]"
              },
              {
                "description": "Reset all routing to default state",
                "name": "reset",
                "options": [],
                "requires_sudo": true,
                "usage": "routing-switch reset [OPTIONS]"
              },
              {
                "description": "Clean up orphaned processes and resources",
                "name": "cleanup",
                "options": [],
                "requires_sudo": true,
                "usage": "routing-switch cleanup [OPTIONS]"
              },
              {
                "description": "Recover from partial failure state",
                "name": "recover",
                "options": [],
                "requires_sudo": true,
                "usage": "routing-switch recover [OPTIONS]"
              }
            ]
          },
          {
            "category": "MICROSOCKS SERVER MANAGEMENT",
            "commands": [
              {
                "description": "Enable microsocks SOCKS5 server for other devices",
                "name": "microsocks-enable",
                "options": [],
                "requires_sudo": true,
                "usage": "routing-switch microsocks-enable -u USERNAME -p PASSWORD [--port PORT]"
              },
              {
                "description": "Disable microsocks SOCKS5 server",
                "name": "microsocks-disable",
                "options": [],
                "requires_sudo": true,
                "usage": "routing-switch microsocks-disable"
              },
              {
                "description": "Show microsocks server status",
                "name": "microsocks-status",
                "options": [],
                "requires_sudo": false,
                "usage": "routing-switch microsocks-status [OPTIONS]"
              }
            ]
          },
          {
            "category": "VPNGATE FREE VPN",
            "commands": [
              {
                "description": "Fetch VPNGate free public VPN server list",
                "name": "vpngate-fetch",
                "options": [],
                "requires_sudo": false,
                "usage": "routing-switch vpngate-fetch [OPTIONS]"
              },
              {
                "description": "List cached VPNGate servers with filtering and sorting",
                "name": "vpngate-list",
                "options": [],
                "requires_sudo": false,
                "usage": "routing-switch vpngate-list [OPTIONS]"
              },
              {
                "description": "Connect to a VPNGate free VPN server by index (no auth required)",
                "name": "vpngate-connect",
                "options": [],
                "requires_sudo": true,
                "usage": "sudo routing-switch vpngate-connect <INDEX> [OPTIONS]"
              },
              {
                "description": "Export a VPNGate server's OpenVPN config as .ovpn file",
                "name": "vpngate-export",
                "options": [],
                "requires_sudo": false,
                "usage": "routing-switch vpngate-export <INDEX> [OPTIONS]"
              },
              {
                "description": "Export all cached VPNGate servers as .ovpn files",
                "name": "vpngate-export-all",
                "options": [],
                "requires_sudo": false,
                "usage": "routing-switch vpngate-export-all [OPTIONS]"
              }
            ]
          }
        ],
        "description": "System-wide traffic routing through various proxy protocols",
        "environmentVariables": [
          {
            "default": "info",
            "description": "Set logging level (default: info)",
            "name": "RUST_LOG",
            "values": "error, warn, info, debug, trace"
          }
        ],
        "exitCodes": {
          "0": "Success",
          "1": "General error",
          "2": "Invalid arguments",
          "3": "Permission denied"
        },
        "globalOptions": [
          {
            "description": "Print help information",
            "flag": "-h, --help"
          },
          {
            "description": "Print version information",
            "flag": "-v, --version"
          },
          {
            "description": "Display detailed information",
            "flag": "-n, --info"
          },
          {
            "description": "Show usage examples",
            "flag": "-e, --examples"
          },
          {
            "description": "Output in JSON format",
            "flag": "--json"
          },
          {
            "description": "Pretty-print JSON output with indentation",
            "flag": "--json-pretty"
          },
          {
            "description": "Enhanced JSON output with improved formatting (like jq)",
            "flag": "--json-human"
          },
          {
            "description": "Enable verbose output",
            "flag": "--verbose"
          }
        ],
        "name": "routing-switch",
        "usage": "routing-switch [OPTIONS] <COMMAND>"
      },
      "errors": [],
      "metadata": {
        "executionTime": 2,
        "hostname": "Boardroom-System",
        "user": "kodachi"
      },
      "status": "success",
      "timestamp": "2026-04-11T17:16:16.091658825Z",
      "version": "9.0.1",
      "warnings": []
    },
    "flag_e": {
      "command": "examples",
      "data": {
        "categories": [
          {
            "description": "Connect to various proxy protocols",
            "examples": [
              {
                "command": "sudo routing-switch connect openvpn",
                "description": "Connect via OpenVPN",
                "expectedOutput": "Successfully connected to OpenVPN server",
                "notes": "Requires OpenVPN configuration in auth card"
              },
              {
                "command": "sudo routing-switch connect wireguard",
                "description": "Connect via WireGuard",
                "expectedOutput": "Successfully connected to WireGuard server",
                "notes": "Ultra-fast, modern VPN protocol"
              },
              {
                "command": "sudo routing-switch connect dante",
                "description": "Connect via Dante SOCKS5 proxy",
                "expectedOutput": "Successfully connected to Dante server"
              },
              {
                "command": "sudo routing-switch connect tor",
                "description": "Route ALL traffic through Tor network (uses redsocks)",
                "expectedOutput": "Successfully routing traffic through Tor",
                "notes": "Maximum anonymity, slower speeds. Uses redsocks for stability instead of tun2socks"
              },
              {
                "command": "sudo routing-switch connect shadowsocks",
                "description": "Connect via Shadowsocks",
                "expectedOutput": "Successfully connected to Shadowsocks server",
                "notes": "Optimized for bypassing censorship"
              },
              {
                "command": "sudo routing-switch connect v2ray",
                "description": "Connect via V2Ray VMess",
                "expectedOutput": "Successfully connected to V2Ray server"
              },
              {
                "command": "sudo routing-switch connect xray-vless",
                "description": "Connect via Xray VLESS TLS",
                "expectedOutput": "Successfully connected to Xray VLESS server",
                "notes": "Lightweight, fast protocol with TLS"
              },
              {
                "command": "sudo routing-switch connect xray-vless-reality",
                "description": "Connect via Xray VLESS Reality",
                "expectedOutput": "Successfully connected to Xray VLESS Reality server",
                "notes": "Most advanced censorship resistance"
              },
              {
                "command": "sudo routing-switch connect xray-trojan",
                "description": "Connect via Xray Trojan",
                "expectedOutput": "Successfully connected to Xray Trojan server",
                "notes": "Mimics HTTPS traffic"
              },
              {
                "command": "sudo routing-switch connect xray-vmess",
                "description": "Connect via Xray VMess",
                "expectedOutput": "Successfully connected to Xray VMess server"
              },
              {
                "command": "sudo routing-switch connect mita",
                "description": "Connect via Mieru/Mita protocol",
                "expectedOutput": "Successfully connected to Mita server",
                "notes": "Anti-censorship protocol"
              },
              {
                "command": "sudo routing-switch connect hysteria2",
                "description": "Connect via Hysteria2 protocol",
                "expectedOutput": "Successfully connected to Hysteria2 server",
                "notes": "UDP-based, high-performance anti-censorship protocol"
              }
            ],
            "id": "basic_connections",
            "title": "BASIC CONNECTIONS"
          },
          {
            "description": "Connect using external configuration files instead of auth card",
            "examples": [
              {
                "command": "sudo routing-switch connect openvpn --config /home/user/vpn.ovpn",
                "description": "Connect using external OpenVPN config file",
                "expectedOutput": "Successfully connected to OpenVPN server",
                "notes": "Supports standard .ovpn configuration files"
              },
              {
                "command": "sudo routing-switch connect wireguard --config /path/to/wg0.conf",
                "description": "Connect using external WireGuard config",
                "expectedOutput": "Successfully connected to WireGuard server",
                "notes": "Uses standard WireGuard .conf format"
              },
              {
                "command": "sudo routing-switch connect shadowsocks --config /path/to/ss-config.json",
                "description": "Connect using Shadowsocks JSON config",
                "expectedOutput": "Successfully connected to Shadowsocks server",
                "notes": "Standard Shadowsocks JSON format with server, port, password, method"
              },
              {
                "command": "sudo routing-switch connect v2ray --config /path/to/v2ray-config.json",
                "description": "Connect using V2Ray JSON config",
                "expectedOutput": "Successfully connected to V2Ray server",
                "notes": "Full V2Ray JSON configuration with inbounds/outbounds"
              },
              {
                "command": "sudo routing-switch connect xray-vless --config /path/to/xray.json",
                "description": "Connect using Xray config file",
                "expectedOutput": "Successfully connected to Xray VLESS server",
                "notes": "Xray JSON config format similar to V2Ray"
              },
              {
                "command": "sudo routing-switch connect openvpn --config ./vpn.ovpn --force",
                "description": "Force connection with external config",
                "expectedOutput": "Disconnecting existing... Connected via external config",
                "notes": "Combines --config with other flags like --force"
              },
              {
                "command": "sudo routing-switch connect shadowsocks --config ~/configs/ss.json --no-tun",
                "description": "External config in no-TUN mode",
                "expectedOutput": "Shadowsocks SOCKS5 proxy ready at localhost:30000",
                "notes": "Use external config for manual proxy setup"
              }
            ],
            "id": "external_config",
            "title": "EXTERNAL CONFIGURATION FILES"
          },
          {
            "description": "Explicitly choose IPv4 or IPv6 connections",
            "examples": [
              {
                "command": "sudo routing-switch connect dante --ipv4",
                "description": "Force IPv4 connection to Dante",
                "expectedOutput": "Connected via IPv4"
              },
              {
                "command": "sudo routing-switch connect dante --ipv6",
                "description": "Force IPv6 connection to Dante",
                "expectedOutput": "Connected via IPv6",
                "notes": "Requires IPv6 support"
              },
              {
                "command": "sudo routing-switch connect shadowsocks --ipv4",
                "description": "Connect Shadowsocks over IPv4",
                "expectedOutput": "Shadowsocks connected via IPv4"
              },
              {
                "command": "sudo routing-switch connect tor --ipv6",
                "description": "Connect Tor over IPv6",
                "expectedOutput": "Tor connected via IPv6"
              },
              {
                "command": "sudo routing-switch connect xray-vless --ipv6",
                "description": "Use IPv6 for Xray VLESS",
                "expectedOutput": "Xray VLESS connected via IPv6"
              },
              {
                "command": "sudo routing-switch connect hysteria2 --ipv4",
                "description": "Connect Hysteria2 over IPv4",
                "expectedOutput": "Hysteria2 connected via IPv4"
              },
              {
                "command": "sudo routing-switch connect hysteria2 --ipv6",
                "description": "Connect Hysteria2 over IPv6",
                "expectedOutput": "Hysteria2 connected via IPv6",
                "notes": "Requires IPv6 support"
              }
            ],
            "id": "ip_version",
            "title": "IPV4/IPV6 SELECTION"
          },
          {
            "description": "Check and manage network prerequisites for VPN connections",
            "examples": [
              {
                "command": "sudo routing-switch check-prerequisites",
                "description": "Check and fix network prerequisites",
                "expectedOutput": "✓ IPv4 forwarding: Already enabled (correct)\n✗→✓ NAT MASQUERADE: Fixed",
                "notes": "Fixes only what's wrong, preserves correct settings"
              },
              {
                "command": "sudo routing-switch check-prerequisites --ipv6",
                "description": "Check prerequisites for IPv6 connections",
                "expectedOutput": "✓ IPv6 forwarding: Enabled",
                "notes": "Only enables IPv6 if system supports it"
              },
              {
                "command": "sudo routing-switch check-prerequisites --json",
                "description": "Get prerequisites status in JSON format",
                "expectedOutput": "{\"prerequisites\": {\"checks\": [...], \"ready\": true}}"
              },
              {
                "command": "sudo routing-switch connect shadowsocks",
                "description": "Connect with automatic prerequisites check",
                "expectedOutput": "Checking network prerequisites...\n✓ All checks passed\n\nConnecting to shadowsocks...",
                "notes": "Prerequisites are checked by default"
              },
              {
                "command": "sudo routing-switch connect shadowsocks --skip-prerequisites",
                "description": "Connect without prerequisites check",
                "expectedOutput": "Connecting to shadowsocks...",
                "notes": "Skips prerequisites for backward compatibility"
              },
              {
                "command": "sudo routing-switch connect wireguard --force",
                "description": "Force reconnection with prerequisites check",
                "expectedOutput": "Checking network prerequisites...\nForcing new connection...",
                "notes": "Prerequisites persist after disconnect for other VPN tools"
              }
            ],
            "id": "prerequisites",
            "title": "NETWORK PREREQUISITES"
          },
          {
            "description": "Check and monitor connection status",
            "examples": [
              {
                "command": "sudo routing-switch status",
                "description": "Show current connection status",
                "expectedOutput": "Protocol: wireguard, Status: Connected",
                "notes": "Requires sudo for accurate results (reads privileged system state)"
              },
              {
                "command": "sudo routing-switch status --json",
                "description": "Get status in JSON format",
                "expectedOutput": "{\"protocol\": \"wireguard\", \"status\": \"connected\"}"
              },
              {
                "command": "sudo routing-switch status --json-pretty",
                "description": "Pretty-printed JSON status",
                "expectedOutput": "Formatted JSON with connection details"
              },
              {
                "command": "sudo routing-switch status --json-human",
                "description": "Human-readable JSON status",
                "expectedOutput": "Enhanced JSON output with descriptions"
              }
            ],
            "id": "status",
            "title": "CONNECTION STATUS"
          },
          {
            "description": "Control DNS routing for security and compatibility (DEFAULT: auto mode)",
            "examples": [
              {
                "command": "sudo routing-switch connect wireguard",
                "description": "DEFAULT: Auto mode (no special DNS routing)",
                "expectedOutput": "DNS handled naturally through tunnel",
                "notes": "DEFAULT safe mode - DNS flows through tunnel like all traffic. Note: May not work with all protocols"
              },
              {
                "command": "sudo routing-switch connect wireguard --dns-mode hybrid",
                "description": "Hybrid mode: VPN server DNS bypasses tunnel",
                "expectedOutput": "Using hybrid DNS mode: VPN server DNS bypasses, others through tunnel",
                "notes": "⚠️ WARNING: May cause internet loss! Use 'sudo routing-switch recover' to restore connectivity. Good balance of security and reliability for home/office use when you need LAN access"
              },
              {
                "command": "sudo routing-switch connect wireguard --dns-mode strict",
                "description": "Strict mode: ALL DNS through tunnel",
                "expectedOutput": "Using strict DNS mode: Maximum security",
                "notes": "Most secure, may fail if VPN server uses hostname"
              },
              {
                "command": "sudo routing-switch connect wireguard --dns-mode system",
                "description": "System mode: DNS bypasses tunnel",
                "expectedOutput": "WARNING: System DNS mode - DNS queries will leak!",
                "notes": "⚠️ NOT SECURE - DNS leaks! Use only for debugging"
              },
              {
                "command": "sudo routing-switch connect wireguard --exclude-private",
                "description": "Exclude private networks from VPN",
                "expectedOutput": "Private networks will bypass VPN tunnel",
                "notes": "Keep LAN access while using VPN"
              },
              {
                "command": "sudo routing-switch connect wireguard --dns-mode hybrid --exclude-private",
                "description": "Hybrid DNS with private network exclusion",
                "expectedOutput": "Using hybrid DNS mode with local network access",
                "notes": "Good for home/office use when you need LAN access"
              }
            ],
            "id": "dns_modes",
            "title": "DNS MODES AND SECURITY"
          },
          {
            "description": "Choose between Direct (secure) or Metric (with fallback) routing",
            "examples": [
              {
                "command": "sudo routing-switch connect tor",
                "description": "DEFAULT: Direct routing mode (MOST SECURE)",
                "expectedOutput": "Using DIRECT routing: Traffic goes ONLY through TUN, no fallback",
                "notes": "✅ RECOMMENDED - Acts as kill switch, no leaks if VPN fails"
              },
              {
                "command": "sudo routing-switch connect tor --metric",
                "description": "Metric routing mode (LESS SECURE, has fallback)",
                "expectedOutput": "Using METRIC routing: Original route kept as backup",
                "notes": "⚠️ WARNING: Can leak traffic if TUN fails! Use only if you need failover"
              },
              {
                "command": "sudo routing-switch connect shadowsocks",
                "description": "Direct mode for Shadowsocks (default)",
                "expectedOutput": "Direct routing: No internet if Shadowsocks stops",
                "notes": "Perfect privacy - connection drops if proxy fails"
              },
              {
                "command": "sudo routing-switch connect dante --metric",
                "description": "Metric mode for corporate VPN scenarios",
                "expectedOutput": "Metric routing: Fallback to original connection if VPN drops",
                "notes": "Use for work VPNs where you need automatic failover"
              },
              {
                "command": "sudo routing-switch connect xray-vless --metric --exclude-private",
                "description": "Metric mode with LAN access preserved",
                "expectedOutput": "Failover routing with local network bypass",
                "notes": "Corporate setup: VPN with failover + LAN access"
              }
            ],
            "id": "routing_modes",
            "title": "ROUTING MODES - SECURITY vs FAILOVER"
          },
          {
            "description": "Disconnect and restore normal routing",
            "examples": [
              {
                "command": "sudo routing-switch disconnect",
                "description": "Disconnect current proxy",
                "expectedOutput": "Successfully disconnected"
              },
              {
                "command": "sudo routing-switch disconnect --force",
                "description": "Force disconnect even if issues",
                "expectedOutput": "Force disconnected",
                "notes": "Kills all processes forcefully"
              },
              {
                "command": "sudo routing-switch disconnect --clean-firewall",
                "description": "Disconnect and clean all firewall rules",
                "expectedOutput": "Disconnected and firewall rules cleaned",
                "notes": "Use when network is stuck after disconnect due to lingering iptables rules"
              },
              {
                "command": "sudo routing-switch disconnect --force --clean-firewall",
                "description": "Force disconnect with complete firewall cleanup",
                "expectedOutput": "Force disconnected, all firewall rules flushed",
                "notes": "Emergency recovery - resets all iptables rules (preserves Docker/KVM chains)"
              },
              {
                "command": "sudo routing-switch disconnect --json",
                "description": "Disconnect with JSON output",
                "expectedOutput": "{\"status\": \"disconnected\"}"
              }
            ],
            "id": "disconnect",
            "title": "DISCONNECTION"
          },
          {
            "description": "Understanding --force behavior and which protocols can layer together",
            "examples": [
              {
                "command": "sudo routing-switch connect wireguard\n    $ sudo routing-switch connect tor --force",
                "description": "Creates LAYERED connection: Tor-over-WireGuard ✓",
                "expectedOutput": "→ Traffic flows through BOTH protocols (double encryption)\n    → WireGuard's wg0 interface remains active\n    → Tor's iptables rules redirect traffic on top",
                "notes": "LAYERED: Both protocols remain active. Traffic: App → Tor (redsocks) → WireGuard → Internet"
              },
              {
                "command": "sudo routing-switch connect openvpn\n    $ sudo routing-switch connect tor --force",
                "description": "Creates LAYERED connection: Tor-over-OpenVPN ✓",
                "expectedOutput": "→ Traffic: Your App → Tor (redsocks) → OpenVPN (tun0) → Internet\n    → Both protocols active simultaneously",
                "notes": "Works because Tor uses iptables NAT, no interface conflict with OpenVPN's tun0"
              },
              {
                "command": "sudo routing-switch connect shadowsocks\n    $ sudo routing-switch connect dante --force",
                "description": "FAILS: Interface conflict ✗",
                "expectedOutput": "→ ERROR: Both protocols need the same tun_routing interface\n    → Cannot have two tun2socks instances\n    → Must disconnect first",
                "notes": "All tun2socks protocols (shadowsocks, dante, v2ray, xray-*, mita, hysteria2) share the same TUN device"
              },
              {
                "command": "sudo routing-switch connect shadowsocks\n    $ sudo routing-switch connect tor --force",
                "description": "May create complex routing (untested)",
                "expectedOutput": "→ Shadowsocks tun_routing remains\n    → Tor adds iptables rules on top\n    → Behavior depends on routing priorities",
                "notes": "Different architectures (tun2socks vs iptables) - may work but not recommended"
              },
              {
                "command": "# PROTOCOL TYPES AND COMPATIBILITY:",
                "description": "Understanding protocol architectures",
                "expectedOutput": "→ Native VPNs (own interfaces): openvpn (tun0), wireguard (wg0)\n    → Redsocks (iptables NAT): tor\n    → Tun2socks (shared tun_routing): shadowsocks, dante, v2ray,\n      xray-vless, xray-vless-reality, xray-trojan, xray-vmess,\n      mita, hysteria2",
                "notes": "Compatible: Native+Tor. Incompatible: Any two tun2socks protocols"
              },
              {
                "command": "# RECOMMENDED LAYERING:",
                "description": "Best practices for using --force",
                "expectedOutput": "→ ✓ WireGuard/OpenVPN first, then Tor --force for double VPN\n    → ✗ Never layer two tun2socks protocols\n    → Test connectivity after layering",
                "notes": "--force allows connection despite existing protocol, but compatibility depends on architecture"
              }
            ],
            "id": "force_reconnect",
            "title": "FORCE FLAG & PROTOCOL COMPATIBILITY"
          },
          {
            "description": "Check DNS configuration",
            "examples": [
              {
                "command": "routing-switch dns-info",
                "description": "Show current DNS servers",
                "expectedOutput": "IPv4: <VPN_IP>:53, IPv6: [<VPN_IPv6>]:53"
              },
              {
                "command": "routing-switch dns-info --json",
                "description": "DNS info in JSON format",
                "expectedOutput": "{\"ipv4\": {\"host\": \"<VPN_IP>\", \"port\": 53}}"
              }
            ],
            "id": "dns_info",
            "title": "DNS INFORMATION"
          },
          {
            "description": "Check Tor DNS and SOCKS configuration",
            "examples": [
              {
                "command": "routing-switch tor-dns-info",
                "description": "Show Tor DNS and SOCKS endpoints",
                "expectedOutput": "DNS: dns://<VPS_IP>:9054#Tor-DNS",
                "notes": "Resolves both regular and .onion domains"
              },
              {
                "command": "routing-switch tor-dns-info --json",
                "description": "Tor DNS info in JSON format",
                "expectedOutput": "{\"ipv4\": {\"dns_url\": \"dns://...\", \"socks_url\": \"socks5://...\"}}"
              }
            ],
            "id": "tor_dns_info",
            "title": "TOR DNS INFORMATION"
          },
          {
            "description": "Display VPS server details and statistics",
            "examples": [
              {
                "command": "routing-switch vps-info",
                "description": "Show basic VPS information",
                "expectedOutput": "Hostname: <type>-<random>, IPv4: <VPS_IP>"
              },
              {
                "command": "routing-switch vps-info --detailed",
                "description": "Show detailed VPS stats",
                "expectedOutput": "CPU Load, Memory Usage, Uptime, Network Connections",
                "notes": "Includes CPU load, memory, uptime, and connection stats"
              },
              {
                "command": "routing-switch vps-info --json",
                "description": "VPS info in JSON format",
                "expectedOutput": "{\"hostname\": \"...\", \"cpu_load\": {...}, \"memory\": {...}}"
              }
            ],
            "id": "vps_info",
            "title": "VPS SERVER INFORMATION"
          },
          {
            "description": "List available protocols with scores",
            "examples": [
              {
                "command": "routing-switch list-protocols",
                "description": "List all available protocols",
                "expectedOutput": "WireGuard (Score: 96.5), OpenVPN (Score: 94.0)..."
              },
              {
                "command": "routing-switch list-protocols --json",
                "description": "Protocol list in JSON",
                "expectedOutput": "[{\"name\": \"wireguard\", \"score\": 96.5}]"
              },
              {
                "command": "routing-switch list-protocols --available-only",
                "description": "Show only available protocols",
                "expectedOutput": "Available: WireGuard, Tor, Shadowsocks",
                "notes": "Based on auth card"
              },
              {
                "command": "routing-switch list-protocols --sort-by-security",
                "description": "Sort by security score",
                "expectedOutput": "1. WireGuard (98.0), 2. OpenVPN (95.0)..."
              },
              {
                "command": "routing-switch list-protocols --sort-by-speed",
                "description": "Sort by speed score",
                "expectedOutput": "1. WireGuard (99.0), 2. Shadowsocks (85.0)..."
              }
            ],
            "id": "list_protocols",
            "title": "PROTOCOL LISTING"
          },
          {
            "description": "Automatically select best protocol",
            "examples": [
              {
                "command": "sudo routing-switch auto-select",
                "description": "Auto-select best protocol",
                "expectedOutput": "Selected WireGuard (best overall score)"
              },
              {
                "command": "sudo routing-switch auto-select --min-security 90",
                "description": "Auto-select with minimum security",
                "expectedOutput": "Selected OpenVPN (security: 95.0)"
              },
              {
                "command": "sudo routing-switch auto-select --prefer-speed",
                "description": "Prioritize speed in selection",
                "expectedOutput": "Selected WireGuard (fastest protocol)"
              },
              {
                "command": "sudo routing-switch auto-select --json",
                "description": "Auto-select with JSON output",
                "expectedOutput": "{\"selected\": \"wireguard\", \"reason\": \"best_score\"}"
              }
            ],
            "id": "auto_select",
            "title": "AUTO-SELECTION"
          },
          {
            "description": "Local SOCKS5 port allocation reference for protocols",
            "examples": [
              {
                "command": "# Port allocation for tun2socks-based protocols",
                "description": "Each protocol uses specific port ranges",
                "expectedOutput": "When connecting, protocols allocate ports automatically:\n\nShadowsocks: 30000-30004\nV2Ray: 30005-30009\nXray VMess: 30010-30014\nXray VLESS: 30015-30019\nVLESS Reality: 30020-30024\nXray Trojan: 30025-30029\nMieru/Mita: 30030-30034\nTor: 30035-30039\nDante: 30040-30044\nHysteria2: 30045-30049",
                "notes": "High port numbers (30000+) avoid conflicts with system services"
              },
              {
                "command": "# Traffic flow for SOCKS5-based protocols",
                "description": "How traffic flows through local SOCKS5 proxy",
                "expectedOutput": "Application → tun_routing interface → tun2socks → localhost:PORT → proxy_client → remote_server",
                "notes": "The local SOCKS5 proxy listens on 127.0.0.1:PORT where PORT is from the allocated range"
              },
              {
                "command": "ss -tlnp | grep 300",
                "description": "Check which local ports are in use",
                "expectedOutput": "tcp LISTEN 0 128 127.0.0.1:30000 *:* users:((\"ss-local\",pid=12345,fd=3))",
                "notes": "Use this command to verify which proxy ports are active"
              },
              {
                "command": "# WireGuard and OpenVPN port usage",
                "description": "Native VPN protocols use different approaches",
                "expectedOutput": "WireGuard: Uses UDP port specified in config (typically 51820)\nOpenVPN: Uses TCP/UDP port specified in config (typically 1194)",
                "notes": "These protocols don't use tun2socks or local SOCKS5 proxies - they connect directly"
              }
            ],
            "id": "port_usage",
            "title": "PORT USAGE INFORMATION"
          },
          {
            "description": "Different JSON output options",
            "examples": [
              {
                "command": "sudo routing-switch status --json",
                "description": "Compact JSON output",
                "expectedOutput": "{\"status\":\"connected\",\"protocol\":\"tor\"}",
                "notes": "Requires sudo for accurate results"
              },
              {
                "command": "sudo routing-switch status --json-pretty",
                "description": "Pretty-printed JSON",
                "expectedOutput": "{\n  \"status\": \"connected\",\n  \"protocol\": \"tor\"\n}"
              },
              {
                "command": "sudo routing-switch status --json-human",
                "description": "Human-enhanced JSON",
                "expectedOutput": "JSON with descriptions and metadata"
              },
              {
                "command": "routing-switch list-protocols --json --json-pretty",
                "description": "Pretty JSON protocol list",
                "expectedOutput": "Formatted JSON array of protocols"
              }
            ],
            "id": "json_formats",
            "title": "JSON OUTPUT FORMATS"
          },
          {
            "description": "Test protocol performance",
            "examples": [
              {
                "command": "routing-switch benchmark",
                "description": "Benchmark all protocols (3 iterations default)",
                "expectedOutput": "WireGuard: 95Mbps, OpenVPN: 75Mbps...",
                "notes": "Tests actual throughput"
              },
              {
                "command": "routing-switch benchmark --iterations 5",
                "description": "Benchmark with custom iteration count",
                "expectedOutput": "Running 5 iterations... WireGuard: 95Mbps...",
                "notes": "More iterations = more accurate results"
              },
              {
                "command": "routing-switch benchmark --json",
                "description": "Benchmark results in JSON",
                "expectedOutput": "{\"wireguard\": {\"download\": 95.5, \"upload\": 90.2}}"
              }
            ],
            "id": "benchmark",
            "title": "BENCHMARKING"
          },
          {
            "description": "Test protocol connectivity without routing",
            "examples": [
              {
                "command": "routing-switch test-protocol tor",
                "description": "Test Tor connectivity",
                "expectedOutput": "Tor: SOCKS5 proxy responding at 127.0.0.1:9050",
                "notes": "Doesn't change routing"
              },
              {
                "command": "routing-switch test-protocol shadowsocks --extended",
                "description": "Extended protocol test",
                "expectedOutput": "Shadowsocks: Connected, Latency: 45ms, Throughput: OK"
              },
              {
                "command": "routing-switch test-protocol all",
                "description": "Test all available protocols",
                "expectedOutput": "Testing: Tor [OK], Shadowsocks [OK], V2Ray [FAIL]..."
              },
              {
                "command": "routing-switch test-protocol wireguard --json",
                "description": "Test with JSON output",
                "expectedOutput": "{\"protocol\": \"wireguard\", \"status\": \"ok\", \"latency\": 12}"
              }
            ],
            "id": "test_protocol",
            "title": "TESTING PROTOCOLS"
          },
          {
            "description": "Run proxy without TUN interface for manual configuration",
            "examples": [
              {
                "command": "sudo routing-switch connect shadowsocks --no-tun",
                "description": "Start Shadowsocks SOCKS5 proxy without TUN",
                "expectedOutput": "Shadowsocks SOCKS5 proxy ready at localhost:30000",
                "notes": "Configure browser/app manually with localhost:30000"
              },
              {
                "command": "sudo routing-switch connect dante --no-tun",
                "description": "Connect to Dante SOCKS5 without routing traffic",
                "expectedOutput": "Dante proxy: host:port, username, password",
                "notes": "Direct connection to remote Dante server"
              },
              {
                "command": "sudo routing-switch connect tor --no-tun",
                "description": "Use Tor SOCKS5 proxy without system routing",
                "expectedOutput": "Tor SOCKS5 proxy: 127.0.0.1:9050",
                "notes": "Tor must be running. Apps connect to port 9050"
              },
              {
                "command": "sudo routing-switch connect v2ray --no-tun --json",
                "description": "V2Ray proxy in manual mode with JSON output",
                "expectedOutput": "{\"local_proxy_address\":\"127.0.0.1\",\"local_proxy_port\":30005}",
                "notes": "V2Ray client runs, no system routing"
              },
              {
                "command": "sudo routing-switch connect xray-vless --no-tun",
                "description": "Xray VLESS proxy for manual configuration",
                "expectedOutput": "Xray SOCKS5 proxy ready at localhost:30015"
              },
              {
                "command": "# Configure Firefox with no-TUN proxy:",
                "description": "Firefox proxy settings example",
                "expectedOutput": "Settings → Network → Manual proxy → SOCKS5: localhost, Port: 30000",
                "notes": "Each protocol uses different port ranges"
              },
              {
                "command": "# Chrome with no-TUN proxy:",
                "description": "Chrome command line example",
                "expectedOutput": "chrome --proxy-server=\"socks5://localhost:30000\""
              },
              {
                "command": "sudo routing-switch disconnect",
                "description": "Stop the proxy (works for both TUN and no-TUN modes)",
                "expectedOutput": "Proxy stopped"
              }
            ],
            "id": "no_tun_mode",
            "title": "NO-TUN MODE (MANUAL PROXY)"
          },
          {
            "description": "Export and display protocol configurations",
            "examples": [
              {
                "command": "routing-switch export-config",
                "description": "Export all configurations to default location",
                "expectedOutput": "Exported 9 configuration(s) to ./results/configs/",
                "notes": "Creates timestamped config files"
              },
              {
                "command": "routing-switch export-config wireguard",
                "description": "Export specific protocol configuration",
                "expectedOutput": "Exported 1 configuration(s) to ./results/configs/\n  - wireguard: wireguard_20250817_143022.conf"
              },
              {
                "command": "routing-switch export-config all --path /tmp/vpn-configs/",
                "description": "Export all configs to custom path",
                "expectedOutput": "Exported 9 configuration(s) to /tmp/vpn-configs/",
                "notes": "Creates directory if it doesn't exist"
              },
              {
                "command": "routing-switch export-config shadowsocks --include-credentials",
                "description": "Export with credentials included",
                "expectedOutput": "Exported 1 configuration(s) to ./results/configs/",
                "notes": "⚠️ WARNING: Contains sensitive passwords"
              },
              {
                "command": "routing-switch export-config --json",
                "description": "Export with JSON output showing results",
                "expectedOutput": "{\"exported_count\": 9, \"export_directory\": \"./results/configs/\", \"files\": [...]}"
              },
              {
                "command": "routing-switch showconfig wireguard",
                "description": "Display WireGuard configuration",
                "expectedOutput": "Protocol Configurations:\n{\"available\": true, \"config_file\": \"wg0.conf\"...}",
                "notes": "Masks sensitive data by default"
              },
              {
                "command": "routing-switch showconfig all --json-pretty",
                "description": "Show all protocol configs in pretty JSON",
                "expectedOutput": "Formatted JSON with all available protocol configurations"
              },
              {
                "command": "routing-switch showconfig dante --mask-sensitive",
                "description": "Show config with passwords hidden",
                "expectedOutput": "{\"username\": \"dante_user\", \"password\": \"***REDACTED***\"}",
                "notes": "Safe for sharing/logging"
              },
              {
                "command": "routing-switch showconfigurl shadowsocks",
                "description": "Get Shadowsocks connection URL",
                "expectedOutput": "ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTp6TDQ4cVYx...@<VPN_IP>:8388#Shadowsocks-IPv4",
                "notes": "URL can be imported into mobile apps"
              },
              {
                "command": "routing-switch showconfigurl dante --json",
                "description": "Get SOCKS5 URLs in JSON format",
                "expectedOutput": "{\"ipv4\": \"socks5://user:pass@<VPN_IP>:1080\", \"ipv6\": \"socks5://user:pass@[<VPN_IPv6>]:1080\"}"
              },
              {
                "command": "routing-switch showconfigurl all",
                "description": "Get URLs for all available protocols",
                "expectedOutput": "Protocol Connection URLs:\n\nshadowsocks:\n  ipv4: ss://...\n\ndante:\n  ipv4: socks5://..."
              },
              {
                "command": "routing-switch showconfigqr wireguard",
                "description": "Generate QR code for WireGuard config",
                "expectedOutput": "[QR Code ASCII Art]\n\nURL: wireguard://base64_encoded_config",
                "notes": "Scan with WireGuard mobile app"
              },
              {
                "command": "routing-switch showconfigqr shadowsocks",
                "description": "Generate IPv4 QR code for Shadowsocks (default)",
                "expectedOutput": "[QR Code ASCII Art]\n\nURL: ss://...",
                "notes": "Shows IPv4 QR code by default for dual-stack protocols"
              },
              {
                "command": "routing-switch showconfigqr shadowsocks --ipv6",
                "description": "Generate IPv6 QR code for Shadowsocks",
                "expectedOutput": "[QR Code ASCII Art]\n\nURL: ss://...",
                "notes": "Use --ipv6 flag to show IPv6 QR for dual-stack protocols"
              },
              {
                "command": "routing-switch showconfigqr shadowsocks --skip-validation",
                "description": "Generate QR without validation (faster)",
                "expectedOutput": "[QR Code ASCII Art]\n\n⚠ Validation skipped",
                "notes": "Skips automatic QR validation for debugging"
              },
              {
                "command": "routing-switch showconfigqr all --strict-validation",
                "description": "Generate all QR codes with strict validation",
                "expectedOutput": "✓ Shadowsocks QR validated\n✓ WireGuard QR validated...",
                "notes": "Fails if any QR code validation fails"
              },
              {
                "command": "routing-switch showconfigqr dante --json",
                "description": "Get QR data in JSON format",
                "expectedOutput": "{\"dante\": {\"url\": \"socks5://...\", \"qr_available\": true}}",
                "notes": "JSON includes the URL for QR generation"
              },
              {
                "command": "routing-switch showconfigqr shadowsocks --save-files",
                "description": "Generate QR code and save as PNG file",
                "expectedOutput": "[QR Code ASCII Art]\n\n✓ IPv4 QR code files saved to ./results/qr-codes/",
                "notes": "Saves clean PNG file: shadowsocks_ipv4.png"
              },
              {
                "command": "routing-switch showconfigqr shadowsocks --ipv6 --save-files",
                "description": "Generate IPv6 QR code and save as PNG file",
                "expectedOutput": "[QR Code ASCII Art]\n\n✓ IPv6 QR code files saved to ./results/qr-codes/",
                "notes": "Saves clean PNG file: shadowsocks_ipv6.png"
              },
              {
                "command": "routing-switch showconfigqr shadowsocks --ipv4 --ipv6 --save-files",
                "description": "Generate both IPv4 and IPv6 QR codes",
                "expectedOutput": "[QR Code ASCII Art]\n\n✓ IPv4 and IPv6 QR code files saved to ./results/qr-codes/",
                "notes": "Saves both shadowsocks_ipv4.png and shadowsocks_ipv6.png"
              },
              {
                "command": "routing-switch showconfigqr all --save-files --json-pretty",
                "description": "Generate all QR codes with pretty JSON output",
                "expectedOutput": "Pretty-formatted JSON with QR data and file paths",
                "notes": "Creates clean PNG files for all available protocols, supports all JSON formats"
              },
              {
                "command": "routing-switch showconfigqr wireguard --save-files --json-human",
                "description": "Save QR file with human-enhanced JSON output",
                "expectedOutput": "{\"qr_code\": \"base64data...\", \"saved_file_path\": \"./results/qr-codes/wireguard.png\"}",
                "notes": "VPN protocols use single filename (no IP version suffix)"
              }
            ],
            "id": "config_export",
            "title": "CONFIGURATION EXPORT AND DISPLAY"
          },
          {
            "description": "Validate QR codes against auth card",
            "examples": [
              {
                "command": "routing-switch validate-qr shadowsocks_ipv4.png",
                "description": "Validate QR code from image file (NEW: direct filename)",
                "expectedOutput": "✓ QR valid: Shadowsocks (confidence: 98.5%)",
                "notes": "Smart detection: automatically finds file in current dir or results/qr-codes/"
              },
              {
                "command": "routing-switch validate-qr dante_ipv4.png",
                "description": "Validate QR code from results/qr-codes directory",
                "expectedOutput": "✓ QR valid: Dante (confidence: 96.2%)",
                "notes": "Automatically looks in ./results/qr-codes/ if not found in current directory"
              },
              {
                "command": "routing-switch validate-qr --file shadowsocks_qr.png",
                "description": "Validate QR code using explicit --file flag (legacy syntax)",
                "expectedOutput": "✓ QR valid: Shadowsocks (confidence: 98.5%)",
                "notes": "Both direct filename and --file flag work identically"
              },
              {
                "command": "echo 'ss://...' | routing-switch validate-qr --stdin",
                "description": "Validate QR URL from stdin",
                "expectedOutput": "✓ Protocol: shadowsocks\n✓ Config matches auth card",
                "notes": "Useful for clipboard validation"
              },
              {
                "command": "routing-switch validate-qr all",
                "description": "Validate all generated QR codes",
                "expectedOutput": "Validating all QR codes...\n✓ shadowsocks_ipv4.png: valid\n✓ wireguard.png: valid",
                "notes": "Checks all QR codes in results/qr-codes/"
              },
              {
                "command": "routing-switch validate-qr --test-readability shadowsocks",
                "description": "Test QR code readability",
                "expectedOutput": "Testing QR readability...\n✓ QR code is readable",
                "notes": "Round-trip test of QR generation"
              },
              {
                "command": "routing-switch validate-qr qr_code.png --json",
                "description": "JSON validation output",
                "expectedOutput": "{\"is_valid\": true, \"protocol\": \"shadowsocks\", \"confidence_score\": 0.985}",
                "notes": "Machine-readable validation results"
              }
            ],
            "id": "qr_validation",
            "title": "QR CODE VALIDATION"
          },
          {
            "description": "Recover from connection issues",
            "examples": [
              {
                "command": "sudo routing-switch disconnect --force",
                "description": "Force disconnect stuck connection",
                "expectedOutput": "Force killed all processes, routes restored",
                "notes": "Use when normal disconnect fails"
              },
              {
                "command": "sudo routing-switch reset",
                "description": "Reset all routing to default",
                "expectedOutput": "Routing reset to system defaults",
                "notes": "Emergency recovery command"
              },
              {
                "command": "sudo routing-switch cleanup",
                "description": "Clean up orphaned processes",
                "expectedOutput": "Cleaned up 2 orphaned tun2socks processes"
              },
              {
                "command": "sudo routing-switch recover",
                "description": "Automatically diagnose and fix routing issues, restore network settings",
                "expectedOutput": "System recovered, ready for new connection",
                "notes": "Performs comprehensive recovery including cleanup, route restoration, and DNS reset"
              }
            ],
            "id": "error_recovery",
            "title": "ERROR RECOVERY"
          },
          {
            "description": "Turn Kodachi into a SOCKS5 proxy server for other devices on your network",
            "examples": [
              {
                "command": "sudo routing-switch microsocks-enable -u microkodachi-8273 -p 'S@Cur9P@s@Wo-Ds'",
                "description": "Enable microsocks server with auto port detection",
                "expectedOutput": "Microsocks server started on port 30050, listening on all interfaces",
                "notes": "Automatically selects available port from 30050-30054 range. Used when Kodachi acts as a server. After connecting routing-switch to any service (WireGuard, V2Ray, etc.), enable microsocks so other PCs on your network can connect through this machine using the listening microsocks port. Strong credentials recommended for security."
              },
              {
                "command": "sudo routing-switch microsocks-enable -u microkodachi-8273 -p 'S@Cur9P@s@Wo-Ds' --port 30051",
                "description": "Enable with specific port",
                "expectedOutput": "Microsocks server started on port 30051",
                "notes": "Use when you need a specific port number within the 30050-30054 range"
              },
              {
                "command": "sudo routing-switch microsocks-status",
                "description": "Check microsocks server status",
                "expectedOutput": "Status: Running, Port: 30050, PID: 12345",
                "notes": "Requires sudo for accurate results (reads privileged state)"
              },
              {
                "command": "sudo routing-switch microsocks-status --json",
                "description": "Check status in JSON format",
                "expectedOutput": "{\"status\":\"running\",\"port\":30050,\"pid\":12345}"
              },
              {
                "command": "sudo routing-switch microsocks-disable",
                "description": "Stop microsocks server",
                "expectedOutput": "Microsocks server stopped successfully"
              },
              {
                "command": "# Complete server workflow:",
                "description": "Full example of using Kodachi as a proxy server",
                "expectedOutput": "Step 1: sudo routing-switch connect wireguard\nStep 2: sudo routing-switch microsocks-enable -u microkodachi-8273 -p 'S@Cur9P@s@Wo-Ds'\nStep 3: Other PCs connect to socks5://microkodachi-8273:S@Cur9P@s@Wo-Ds@YOUR_IP:30050",
                "notes": "WORKFLOW: First connect routing-switch to any service (WireGuard, V2Ray, Shadowsocks, Hysteria2, etc.). Then enable microsocks to create a SOCKS5 proxy server. Other devices on your network can now connect through YOUR_IP:PORT using the provided credentials. All their traffic will flow through your active routing-switch connection."
              },
              {
                "command": "# Port range information:",
                "description": "Microsocks uses dedicated port range",
                "expectedOutput": "Microsocks: 30050-30054\nOther services use different ranges to avoid conflicts",
                "notes": "High port numbers (30000+) avoid conflicts with system services. Each protocol has its own dedicated range."
              },
              {
                "command": "# Client connection example:",
                "description": "How other devices connect",
                "expectedOutput": "Protocol: SOCKS5\nAddress: YOUR_KODACHI_IP (e.g., 192.168.1.100)\nPort: 30050\nUsername: microkodachi-8273\nPassword: S@Cur9P@s@Wo-Ds",
                "notes": "Configure client device browsers/applications to use this SOCKS5 proxy. All traffic from client will be routed through Kodachi's active connection."
              }
            ],
            "id": "microsocks_server",
            "title": "MICROSOCKS SERVER MODE"
          },
          {
            "description": "Connect to free VPNGate public servers (no authentication required)",
            "examples": [
              {
                "command": "routing-switch vpngate-fetch",
                "description": "Fetch VPNGate server list from public API",
                "expectedOutput": "Fetched 150 VPNGate servers",
                "notes": "Downloads and caches server list (refreshes every hour)"
              },
              {
                "command": "routing-switch vpngate-list",
                "description": "List all cached VPNGate servers",
                "expectedOutput": "Index Flag Country IP Speed Ping Score Sessions",
                "notes": "Shows servers sorted by score (default)"
              },
              {
                "command": "routing-switch vpngate-list --country JP --sort speed -l 10",
                "description": "List top 10 Japanese servers by speed",
                "expectedOutput": "10 servers shown, filtered by country: JP",
                "notes": "Filter by country name or code, sort by speed/ping/score/sessions"
              },
              {
                "command": "routing-switch vpngate-list --country US --sort ping",
                "description": "List US servers sorted by lowest ping",
                "expectedOutput": "Servers sorted by ping latency"
              },
              {
                "command": "sudo routing-switch vpngate-connect 5",
                "description": "Connect to VPNGate server at index 5",
                "expectedOutput": "Successfully connected to <server> via openvpn",
                "notes": "Uses OpenVPN with free vpn/vpn credentials"
              },
              {
                "command": "sudo routing-switch vpngate-connect 12 --force",
                "description": "Force connect to server 12 (disconnect existing first)",
                "expectedOutput": "Force connected to VPNGate server"
              },
              {
                "command": "routing-switch vpngate-fetch --json",
                "description": "Fetch servers with JSON output",
                "expectedOutput": "{\"status\":\"success\",\"server_count\":150}"
              },
              {
                "command": "routing-switch vpngate-list --json-pretty",
                "description": "List servers in pretty JSON format",
                "expectedOutput": "Pretty-printed JSON array of servers"
              },
              {
                "command": "routing-switch vpngate-export 1",
                "description": "Export top server's OpenVPN config as .ovpn file",
                "expectedOutput": "Exported: JP Japan (1.2.3.4) -> results/vpngate-configs/1_jp_1-2-3-4.ovpn",
                "notes": "Includes embedded vpn/vpn credentials for standalone use"
              },
              {
                "command": "routing-switch vpngate-export-all",
                "description": "Export all cached servers as .ovpn files",
                "expectedOutput": "Exported 99 VPNGate configs to results/vpngate-configs",
                "notes": "Bulk export for use in external OpenVPN clients"
              },
              {
                "command": "routing-switch vpngate-export 5 --json",
                "description": "Export server #5 config with JSON output",
                "expectedOutput": "{\"status\":\"success\",\"action\":\"vpngate-export\",\"file\":\"...\"}"
              }
            ],
            "id": "vpngate_free_vpn",
            "title": "VPNGATE FREE VPN"
          }
        ],
        "description": "System-wide traffic routing through various proxy protocols",
        "name": "routing-switch",
        "quickReference": [
          "sudo routing-switch connect [PROTOCOL] - Connect to proxy",
          "sudo routing-switch disconnect - Disconnect current proxy",
          "sudo routing-switch status - Check connection status (needs sudo for accurate results)",
          "routing-switch list-protocols - Show available protocols",
          "Use --json for JSON output, --verbose for details",
          "Paid connections require authentication via online-auth",
          "VPNGate connections (vpngate-*) are free and do not require authentication"
        ]
      },
      "errors": [],
      "metadata": {
        "executionTime": 2,
        "hostname": "Boardroom-System",
        "user": "kodachi"
      },
      "status": "success",
      "timestamp": "2026-04-11T17:16:16.544244482Z",
      "version": "9.0.1",
      "warnings": []
    }
  }
}
