Using Proxy with Camoufox Fetch | Generated by AI

Home 2026.04

Question: How to use a proxy with npx camoufox-js fetch to speed up the slow download in China?

Answer:

Here is how to make the Camoufox download go through your proxy (this is the most reliable way when you are in China and the direct download is extremely slow).

Before running the fetch command, set the proxy environment variables in your terminal:

For most proxies (HTTP/HTTPS proxy):

export HTTP_PROXY=http://your-proxy-ip:port
export HTTPS_PROXY=http://your-proxy-ip:port

If your proxy requires username and password:

export HTTP_PROXY=http://username:password@your-proxy-ip:port
export HTTPS_PROXY=http://username:password@your-proxy-ip:port

Example with a common local proxy like Clash/V2Ray (port 7890):

export HTTP_PROXY=http://127.0.0.1:7890
export HTTPS_PROXY=http://127.0.0.1:7890

Then run the fetch command:

npx camoufox-js fetch

You can combine them in one line:

HTTP_PROXY=http://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 npx camoufox-js fetch

2. If You Want to Force Re-download

HTTP_PROXY=http://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 npx camoufox-js fetch --force

3. Make It Permanent (Optional)

Add the export lines to your shell profile so they apply every time:

4. Alternative: Use npm config (sometimes helps with npx)

npm config set proxy http://127.0.0.1:7890
npm config set https-proxy http://127.0.0.1:7890
npx camoufox-js fetch

Important Tips:

5. Check If Proxy Is Working

Before running the big download, test with a small command:

HTTP_PROXY=http://127.0.0.1:7890 curl -I https://www.google.com

If it returns headers quickly, the proxy is working for downloads.

Try the environment variable method first — it works for most users facing the same slow download issue with Camoufox in China. Let me know the exact proxy you are using (e.g., port and type) if it still doesn’t work, and I can give more specific commands.

References:


Back Donate