<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: wang1559458306</title>
    <description>The latest articles on DEV Community by wang1559458306 (@wang1559458306).</description>
    <link>https://dev.to/wang1559458306</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4281027%2Fce7f0f5d-84cf-4495-bc23-589c60140bb5.png</url>
      <title>DEV Community: wang1559458306</title>
      <link>https://dev.to/wang1559458306</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wang1559458306"/>
    <language>en</language>
    <item>
      <title>Unity's CDN redirects mainland China IPs to an empty bucket — I measured it and built a downloader</title>
      <dc:creator>wang1559458306</dc:creator>
      <pubDate>Thu, 03 Dec 2026 16:03:20 +0000</pubDate>
      <link>https://dev.to/wang1559458306/unitys-cdn-redirects-mainland-china-ips-to-an-empty-bucket-i-measured-it-and-built-a-downloader-46dl</link>
      <guid>https://dev.to/wang1559458306/unitys-cdn-redirects-mainland-china-ips-to-an-empty-bucket-i-measured-it-and-built-a-downloader-46dl</guid>
      <description>&lt;p&gt;Unity Hub kept failing downloads with "verification failed". Retrying didn't help. The official direct links returned 404. I spent a night measuring what actually happens, and the answer is more interesting than "slow network": &lt;strong&gt;Unity's download CDN 302-redirects mainland China IPs to an OSS bucket that contains no international builds at all.&lt;/strong&gt; Hub's "verification failed" literally means the file doesn't exist there.&lt;/p&gt;

&lt;p&gt;Here's the full measurement log. Everything is reproducible.&lt;/p&gt;

&lt;h2&gt;
  
  
  The redirect
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;$ curl -I https://download.unity3d.com/download_unity/f4e960bd2f88/Windows64EditorInstaller/UnitySetup64-7000.0.0a20.exe
HTTP/1.1 302 Moved Temporarily
Server: AkamaiGHost
Location: https://download.unitychina.cn/download_unity/f4e960bd2f88/Windows64EditorInstaller/UnitySetup64-7000.0.0a20.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All four download hosts (&lt;code&gt;download.&lt;/code&gt;, &lt;code&gt;netstorage.&lt;/code&gt;, &lt;code&gt;beta.&lt;/code&gt;, &lt;code&gt;public-cdn.cloud.&lt;/code&gt;) redirect. The target bucket is empty:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Probe&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Unity 7.0 alpha installer&lt;/td&gt;
&lt;td&gt;404 &lt;code&gt;NoSuchKey&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unity 6.0 installer&lt;/td&gt;
&lt;td&gt;404 &lt;code&gt;NoSuchKey&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unity 2022.3 installer&lt;/td&gt;
&lt;td&gt;404 &lt;code&gt;NoSuchKey&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenJDK component&lt;/td&gt;
&lt;td&gt;404&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bucket root&lt;/td&gt;
&lt;td&gt;403&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;Server: AliyunOSS&lt;/code&gt;, error body &lt;code&gt;&amp;lt;Code&amp;gt;NoSuchKey&amp;lt;/Code&amp;gt;&lt;/code&gt;. The bucket exists; international builds simply aren't in it. The Tuanjie (团结引擎) CDN doesn't mirror international builds either — only its own &lt;code&gt;t&lt;/code&gt;-suffixed versions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Falsified: 8 kinds of header spoofing
&lt;/h2&gt;

&lt;p&gt;What does the region check look at? I tried:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Spoof&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;X-Forwarded-For: 8.8.8.8&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;302&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;True-Client-IP&lt;/code&gt; / &lt;code&gt;CF-Connecting-IP&lt;/code&gt; / &lt;code&gt;X-Real-IP&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;302&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Accept-Language: en-US&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;302&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;User-Agent: UnityPackageManager/1.0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;302&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Query params (&lt;code&gt;?x=1&lt;/code&gt;, &lt;code&gt;?download=1&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;302&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;--resolve&lt;/code&gt; to an overseas Akamai IP&lt;/td&gt;
&lt;td&gt;302&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The decision is based on &lt;strong&gt;source IP only&lt;/strong&gt;. No header trickery works. Plain HTTP, public CORS proxies, WARP endpoints, and Docker mirrors all failed too (documented in the repo so nobody retries them).&lt;/p&gt;

&lt;h2&gt;
  
  
  The opening: metadata APIs are directly reachable
&lt;/h2&gt;

&lt;p&gt;Only file bodies are redirected. The metadata layer works fine from the mainland:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;services.api.unity.com&lt;/code&gt; (version/module manifests): 200 in 734 ms&lt;/li&gt;
&lt;li&gt;Hub's releases JSON: 200&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dl.google.com&lt;/code&gt; (Android NDK/CMake): 9–10 MB/s direct&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So resolving versions, module lists, official URLs and MD5s can all be done directly. The only missing piece is moving the file bodies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving files: free proxy pool + chunked concurrency
&lt;/h2&gt;

&lt;p&gt;Free proxies are individually terrible. One round: 7,082 candidates scraped → 584 alive → 158 with measurable speed → fastest 0.69 MB/s.&lt;/p&gt;

&lt;p&gt;But the bottleneck is &lt;strong&gt;per-connection throttling&lt;/strong&gt;, not total bandwidth. Same proxy, same URL, varying concurrency:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Threads&lt;/th&gt;
&lt;th&gt;Throughput&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0.74 MB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;2.54 MB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;32&lt;/td&gt;
&lt;td&gt;3.68 MB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64&lt;/td&gt;
&lt;td&gt;4.83 MB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;96&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;6.46 MB/s&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;128&lt;/td&gt;
&lt;td&gt;4.57 MB/s (falls back)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Long-run check: 512 MB in 256 chunks at 4.31 MB/s, with 2 chunks needing a retry pass (chunk-level retry covers this).&lt;/p&gt;

&lt;p&gt;Final design: public APIs resolve official links → free proxy pool with health scoring → chunked concurrent downloads → SHA256/MD5 verification. Real results:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;th&gt;Speed&lt;/th&gt;
&lt;th&gt;Verified&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Unity 7.0 alpha editor&lt;/td&gt;
&lt;td&gt;3.52 GB&lt;/td&gt;
&lt;td&gt;2.6 MB/s, 23.8 min&lt;/td&gt;
&lt;td&gt;MD5 ✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Android Support module&lt;/td&gt;
&lt;td&gt;1.63 GB&lt;/td&gt;
&lt;td&gt;1.7 MB/s, 16.6 min&lt;/td&gt;
&lt;td&gt;MD5 ✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Windows IL2CPP module&lt;/td&gt;
&lt;td&gt;284 MB&lt;/td&gt;
&lt;td&gt;1.2 MB/s, 3.8 min&lt;/td&gt;
&lt;td&gt;MD5 ✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Editor MD5 matches Unity's published value; installer signature is valid. Slow, but no VPN and no paid proxy — it finishes and verifies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus pitfall: NSIS path length
&lt;/h2&gt;

&lt;p&gt;The silent install (&lt;code&gt;/S&lt;/code&gt;) failed with exit code 2, "Error writing temporary file". Ruled out: TEMP writability, disk space (7.54 GB needed, 19.2 GB free), ACLs, package corruption (Authenticode Valid, byte count exact), CRC (&lt;code&gt;/NCRC&lt;/code&gt; still failed). Copying the installer to &lt;code&gt;D:\u7.exe&lt;/code&gt; and rerunning: exit code 0. &lt;strong&gt;The cause was path length&lt;/strong&gt; (&lt;code&gt;LongPathsEnabled = 0&lt;/code&gt;), not permissions or antivirus. Module installers reproduce it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tool
&lt;/h2&gt;

&lt;p&gt;I turned the whole investigation into an open-source tool, &lt;strong&gt;unitycn&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;List versions, download editors and modules (including Android SDK/NDK/JDK path setup)&lt;/li&gt;
&lt;li&gt;Zero dependencies, Python 3.9+, CI on Windows/macOS/Linux&lt;/li&gt;
&lt;li&gt;23 unit tests; every measurement above lives in &lt;code&gt;docs/MEASUREMENTS.md&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/wang1559458306/unitycn" rel="noopener noreferrer"&gt;https://github.com/wang1559458306/unitycn&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're in a region with similar CDN weirdness, I'd love to hear whether the numbers look the same from your network — more samples make the conclusion sturdier.&lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>gamedev</category>
      <category>opensource</category>
      <category>python</category>
    </item>
  </channel>
</rss>
