Skip to content

andongya95/qg-proxy-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

QG Proxy Tutorial (青果网络代理教程)

A quick guide to using QG.net (青果网络) tunnel proxy in Python for web scraping with automatic IP rotation.

What is QG Proxy?

QG.net provides residential proxy services in China. The tunnel proxy mode automatically rotates your IP address on every request — no manual IP management needed.

Official docs:

Setup

1. Get Credentials

Sign up at qg.net and purchase a tunnel proxy plan. You'll receive:

  • Authkey — your authentication key
  • Authpwd — your authentication password
  • Address — tunnel server (e.g. tun-xxxxx.qg.net:12345)

2. Create .env File

cp .env.example .env

Edit .env with your credentials:

TUNNEL_PROXY_URL=http://YOUR_AUTHKEY:YOUR_AUTHPWD@tun-xxxxx.qg.net:PORT

3. Install Dependencies

pip install requests

4. Run

python example.py

How It Works

The tunnel proxy URL format is:

http://AUTHKEY:AUTHPWD@SERVER:PORT

Pass it as both http and https proxy to requests:

proxies = {
    "http": "http://AUTHKEY:AUTHPWD@tun-xxxxx.qg.net:12345",
    "https": "http://AUTHKEY:AUTHPWD@tun-xxxxx.qg.net:12345",
}
response = requests.get("https://httpbin.org/ip", proxies=proxies)

Each request automatically gets a fresh Chinese IP address (普通模式: 每次请求都自动切换IP).

Tips

  • Connection: close — Add this header so each request gets a new connection (and new IP):
    headers = {"Connection": "close"}
  • Don't use requests.Session with some sites — sessions reuse connections, which may bypass IP rotation or trigger blocks. Use raw requests.get() if you encounter issues.
  • Rate limiting — Add time.sleep(2) between requests to avoid triggering target site rate limits.
  • Error -11 (请求过于频繁) — You're calling the proxy API too fast. Back off 15-30 seconds.

Files

File Purpose
example.py Sample script demonstrating tunnel proxy usage
.env.example Template for proxy credentials
.gitignore Keeps .env out of git

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages