How to Stop Waiting Forever for Dependencies and Images to Download
A familiar story: you run npm install, docker pull, or try to pull a hefty model from Hugging Face, and... go get coffee. Or maybe even lunch. It gets especially "fun" when you're working in a corporate network with strict proxies, or just in a region where reaching GitHub or Docker Hub servers is quite an adventure.
Recently came across a project called Xget. This isn't just another "mirror wrapper" — it's a full-fledged acceleration engine for developer resources. It can accelerate the delivery of code, models, packages, and even neural network inference via API. It runs on Cloudflare Workers, which means content reaches you from the CDN node closest to your home or office.
What this thing can do
Xget works as a single entry point. Instead of configuring a dozen different proxies for each tool, you use one domain.
The project supports an absurd number of platforms:
- Repositories: GitHub, GitLab, Gitea, Codeberg.
- Package managers: npm, PyPI, Conda, Maven, Homebrew, Crates.io (Rust), Go Modules.
- AI resources: Hugging Face, Civitai.
- Containers: Docker Hub, Quay, GCR, GHCR.
- Linux distributions: Debian, Ubuntu, Arch, Fedora.
- Even neural network APIs: OpenAI, Anthropic, Gemini, and others.
The idea is simple: take the original link, add the platform prefix to the Xget domain, and the on-the-fly caching magic starts working.
How it works under the hood
The author didn't reinvent the wheel and built the solution on a modern stack. The foundation is Cloudflare Workers. This gives two main benefits: minimal latency due to distributed nodes and protection against server outages — if one data center goes down, another picks up the request.
Here's what the request processing looks like:
The engine analyzes what you're requesting. If it's Git traffic, specific adapters for the Git protocol kick in (even git push and LFS are supported). If it's a request to a Docker registry — the authorization logic and image layer transfer kicks in.
Caching is implemented in an interesting way. Xget doesn't just proxy bytes. It understands the difference between metadata (which changes often) and artifacts like .zip or .tar.gz archives (which are immutable). The former gets updated more frequently, the latter stays in cache for a long time.
Security isn't just empty talk
Usually there are questions about public proxy servers: who sees my traffic? Will they swap my binary? Xget has several layers of protection built in:
- Strict security headers (HSTS, CSP, X-Frame-Options). This is the basics, but many forget about it.
- Path validation. You can't pass an overly long URL or try to escape beyond allowed directories (protection against path traversal).
- Method whitelist. Only GET and HEAD are allowed for regular downloads. POST and others are only opened where they're actually needed (for example, for Git LFS or AI API).
By the way, the project is fully Open Source. If you don't trust the public instance xget.xi-xu.me, you can deploy your own personal instance in your Cloudflare account in five minutes, or even in Docker on your own server.
Practical examples
The most useful part is how Xget integrates into your daily routine.
Accelerating Git
If git clone is crawling at a turtle's pace, you can configure a global domain replacement:
git config --global url."https://xget.xi-xu.me/gh/".insteadOf "https://github.com/"
Now any request to GitHub will automatically go through the accelerator. Transparent and convenient.
Working with Docker without the pain
Instead of struggling with daemon.json configuration, you can simply specify the prefix when pulling:
docker pull xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest
AI development
For those working with models, there's a great feature for Hugging Face. Just pass one environment variable to your Python script:
import os
os.environ['HF_ENDPOINT'] = 'https://xget.xi-xu.me/hf'
After that, the transformers library will start downloading model weights through the mirror.
Is it worth adopting
Xget is an excellent "Swiss Army knife" for those tired of network problems.
Who will definitely find it useful:
- Developers in regions with unstable access to foreign resources.
- DevOps engineers for accelerating image builds in CI/CD pipelines.
- Data Science specialists who download model weights by the gigabyte.
Some nuances: the free public instance has its limits, so for serious projects it's better to spend 10 minutes and deploy your own worker in Cloudflare. Fortunately, the repository has ready-made actions for automatic deployment.
The project is alive and actively gaining stars (over 8,000 already) and support for new platforms. If you need one solution for all your resource download problems — Xget definitely deserves a spot in your bookmarks.
Related projects