{"id":91,"date":"2025-10-17T13:35:05","date_gmt":"2025-10-17T05:35:05","guid":{"rendered":"https:\/\/dreamhax.cc\/?p=91"},"modified":"2025-12-25T13:39:29","modified_gmt":"2025-12-25T05:39:29","slug":"implementing-a-proxy-on-windows-using-standalone-mihomo-and-metacubexd","status":"publish","type":"post","link":"https:\/\/en.dreamhax.cc\/index.php\/2025\/10\/17\/implementing-a-proxy-on-windows-using-standalone-mihomo-and-metacubexd\/","title":{"rendered":"Implementing a Proxy on Windows using Standalone Mihomo and MetaCubeXD"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Some scripts and concepts are credited to the <a href=\"https:\/\/linux.do\/t\/topic\/236719\">Linux.do community<\/a>. <\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Mihomo Installation &amp; Configuration<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">Install Mihomo via Scoop<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>bucket add main\nscoop install main\/mihomo<\/code><\/pre>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Create Configuration File<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Example configuration (<code>config.yaml<\/code>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ipv6: false\nexternal-controller: 0.0.0.0:9090\nexternal-ui: ui\ngeodata-mode: true  # Enable .dat mode to show rule counts on the dashboard\ngeo-auto-update: true\ngeo-update-interval: 24\ngeox-url:\n  geoip: \"&#91;https:\/\/fastly.jsdelivr.net\/gh\/MetaCubeX\/meta-rules-dat@release\/geoip-lite.dat](https:\/\/fastly.jsdelivr.net\/gh\/MetaCubeX\/meta-rules-dat@release\/geoip-lite.dat)\"  # Lite version for smaller footprint\ntun:\n  enable: true\n  auto-route: true\n  auto-detect-interface: true\n  strict-route: true\n  stack: system\n  dns-hijack:\n    - 0.0.0.0:53\ndns:\n  enable: true\n  listen: 0.0.0.0:53\n  enhanced-mode: fake-ip\n  fake-ip-range: 198.18.0.1\/16\n  fake-ip-filter:\n    - '*.lan'\n    - localhost.ptlogin2.qq.com\n    - +.msftconnecttest.com\n    - +.msftncsi.com\n  nameserver:\n    - system  # Use system DNS for best compatibility and speed\nproxy-providers:\n  XXX:\n    type: http\n    url: \"XXX\"  # Your subscription link\n    path: .\/XXX.yaml\n    interval: 86400\nproxy-groups:\n  - name: \"PROXY\"\n    type: select\n    use:\n      - XXX\nrule-providers:\n  global:\n    type: http\n    path: .\/global.yaml\n    url: \"&#91;https:\/\/fastly.jsdelivr.net\/gh\/ACL4SSR\/ACL4SSR@master\/Clash\/Providers\/ProxyLite.yaml](https:\/\/fastly.jsdelivr.net\/gh\/ACL4SSR\/ACL4SSR@master\/Clash\/Providers\/ProxyLite.yaml)\"\n    interval: 86400\n    proxy: DIRECT\n    behavior: classical\n    format: yaml\n  china:\n    type: http\n    path: .\/china.yaml\n    url: \"&#91;https:\/\/fastly.jsdelivr.net\/gh\/ACL4SSR\/ACL4SSR@master\/Clash\/Providers\/ChinaDomain.yaml](https:\/\/fastly.jsdelivr.net\/gh\/ACL4SSR\/ACL4SSR@master\/Clash\/Providers\/ChinaDomain.yaml)\"\n    interval: 86400\n    proxy: DIRECT\n    behavior: classical\n    format: yaml\nrules:\n  - GEOIP,private,DIRECT,no-resolve  # Add 'no-resolve' before GEOIP rules to prevent premature DNS resolution\n  - RULE-SET,global,PROXY,no-resolve\n  - RULE-SET,china,DIRECT,no-resolve\n  - GEOIP,cn,DIRECT\n  - MATCH,PROXY<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Alternatively, refer to the <a href=\"https:\/\/wiki.metacubex.one\/config\/general\/\">official documentation<\/a> or <a href=\"https:\/\/linux.do\/t\/topic\/163682\">community guides<\/a> for custom configurations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Create Launch Script<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can launch the <code>.exe<\/code> directly, or use a silent <code>mihomo.vbs<\/code> script (remember to update the paths):<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Option A: With logging<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set mihomo = CreateObject(\"WScript.Shell\")\nmihomo.CurrentDirectory = \"D:\\Software\\Scoop\\apps\\mihomo\\current\"\nmihomo.Run \"cmd \/c \"\"D:\\Software\\Scoop\\apps\\mihomo\\current\\mihomo.exe -d . > D:\\Software\\Scoop\\apps\\mihomo\\current\\mihomo.log 2>&amp;1\"\"\", 0, false<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Option B: No logging<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set mihomo = CreateObject(\"WScript.Shell\")\nmihomo.CurrentDirectory = \"D:\\Software\\Scoop\\apps\\mihomo\\current\"\nmihomo.Run \"mihomo.exe -d .\", 1, true<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">MetaCubeXD Installation &amp; Configuration<\/h1>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Visit the <a href=\"https:\/\/github.com\/MetaCubeX\/metacubexd\" target=\"_blank\" rel=\"noreferrer noopener\">MetaCubeX\/metacubexd<\/a> GitHub repository.<\/li>\n\n\n\n<li>Download the latest Release and extract it.<\/li>\n\n\n\n<li>Create a <code>.bat<\/code> script in the extracted directory (to avoid typing the command every time):<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>@echo off\nREM Switch CMD code page to UTF-8 (65001) for correct character display\nchcp 65001\n\nREM Set the path for the website root directory\nset WEB_ROOT=D:\\metacubexd\n\nREM Check and switch to the target path\necho Attempting to switch to directory: %WEB_ROOT%\ncd \/d \"%WEB_ROOT%\"\nif %errorlevel% neq 0 (\n    echo.\n    echo ERROR: Could not switch to directory %WEB_ROOT%.\n    echo Please verify the path exists.\n    pause\n    exit \/b 1\n)\n\nREM Check for Python\nwhere python >nul 2>nul\nif %errorlevel% neq 0 (\n    echo.\n    echo ERROR: Python command not found.\n    pause\n    exit \/b 1\n)\n\nREM Start HTTP Server\necho.\necho ----------------------------------------------------\necho \ud83c\udf89 Python HTTP Server started successfully!\necho \ud83c\udf10 URL: &#91;http:\/\/127.0.0.1:8000](http:\/\/127.0.0.1:8000)\necho \ud83d\udcc1 Root Directory: %WEB_ROOT%\necho ----------------------------------------------------\necho.\n\nREM Start server using default port 8000\npython -m http.server 8000\n\nREM Pause if server stops\necho.\necho HTTP Server has stopped.\npause<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">Summary<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">You are all set!<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Postscript:<\/strong> If you prefer a graphical interface, there are two excellent alternative projects: <strong><a href=\"https:\/\/github.com\/GUI-for-Cores\/GUI.for.Clash\">GUI.for.Clash<\/a><\/strong> and <strong><a href=\"https:\/\/github.com\/GUI-for-Cores\/GUI.for.SingBox\">GUI.for.SingBox<\/a><\/strong>.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create Configuration File Example configuration (config.yaml): Alternatively, refer to the official documentation or community guides for custom configurations. Create Launch Script You can launch the .exe directly, or use a silent mihomo.vbs script (remember to update the paths): Option A: With logging Option B: No logging MetaCubeXD Installation &amp; Configuration Summary You are all set! [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[107],"tags":[26,27,25,24,8,10],"class_list":["post-91","post","type-post","status-publish","format-standard","hentry","category-software","tag-clash","tag-dashboard","tag-mihomo","tag-proxy","tag-scoop","tag-windows"],"_links":{"self":[{"href":"https:\/\/en.dreamhax.cc\/index.php\/wp-json\/wp\/v2\/posts\/91","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/en.dreamhax.cc\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/en.dreamhax.cc\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/en.dreamhax.cc\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/en.dreamhax.cc\/index.php\/wp-json\/wp\/v2\/comments?post=91"}],"version-history":[{"count":1,"href":"https:\/\/en.dreamhax.cc\/index.php\/wp-json\/wp\/v2\/posts\/91\/revisions"}],"predecessor-version":[{"id":93,"href":"https:\/\/en.dreamhax.cc\/index.php\/wp-json\/wp\/v2\/posts\/91\/revisions\/93"}],"wp:attachment":[{"href":"https:\/\/en.dreamhax.cc\/index.php\/wp-json\/wp\/v2\/media?parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/en.dreamhax.cc\/index.php\/wp-json\/wp\/v2\/categories?post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/en.dreamhax.cc\/index.php\/wp-json\/wp\/v2\/tags?post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}