Cloudflare Solver - HTTP client over LinkSocks tunnels
Project description
CFSolver
Python HTTP client that automatically bypasses Cloudflare challenges.
Installation
pip install cfsolver
Features
- Drop-in replacement for
requestsandhttpx - Automatic challenge detection and solving
- Flexible solving modes: auto-detect, always solve, or disable
- Proxy support for both HTTP requests and API calls
- Compatible with synchronous and asynchronous code
Quick Start
Works just like requests, but automatically handles Cloudflare challenges:
from cfsolver import CloudflareSolver
solver = CloudflareSolver("your-api-key")
response = solver.get("https://protected-site.com")
print(response.text)
Usage
Basic Usage (Auto-solve on challenge)
from cfsolver import CloudflareSolver
# Default: solve only when challenge is detected
solver = CloudflareSolver("your-api-key")
response = solver.get("https://example.com/")
print(response.text)
Solving Modes
from cfsolver import CloudflareSolver
# Mode 1: Solve only when CF challenge is detected (default, recommended)
solver = CloudflareSolver("your-api-key")
# Mode 2: Always pre-solve before each request (slow but most reliable)
solver = CloudflareSolver("your-api-key", solve=True, on_challenge=False)
# Mode 3: Disable solving entirely (direct requests only)
solver = CloudflareSolver("your-api-key", solve=False)
With Proxies
# Use proxy for HTTP requests only
solver = CloudflareSolver(
"your-api-key",
proxy="http://your-proxy:8080"
)
# Use separate proxies for HTTP requests and API calls
solver = CloudflareSolver(
"your-api-key",
proxy="http://proxy-for-http-requests:8080",
api_proxy="http://proxy-for-api-calls:8081"
)
Context Manager
with CloudflareSolver("your-api-key") as solver:
resp = solver.get("https://example.com/")
print(resp.json())
Parameters
api_key: Your API key (required)api_base: CloudFlyer service URL (default:https://cloudflyer.zetx.tech)solve: Enable challenge solving (defaultTrue, set toFalseto disable completely)on_challenge: Solve only on challenge detection (defaultTrue), or always pre-solve (False)proxy: Proxy for outgoing HTTP requests (optional)api_proxy: Proxy for service API calls (optional)
Security Notes
- Token generation: Connector tokens are auto-generated internally using
secrets.token_urlsafe()for cryptographically secure randomness, never exposed to users - Proxy separation: HTTP requests use
proxyparameter, while API calls useapi_proxyparameter for independent proxy configuration
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cfsolver-0.1.0.tar.gz.
File metadata
- Download URL: cfsolver-0.1.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29440e68f38ccca601dff2992e7a8929b4f692a1d5737e59b78af9807f0248ec
|
|
| MD5 |
df278a09803657ede32b85811a00c867
|
|
| BLAKE2b-256 |
23d0c30d27b61b09547316267f883af08d17c0257fd21e5dd1ad881e8f0adb70
|
Provenance
The following attestation bundles were made for cfsolver-0.1.0.tar.gz:
Publisher:
pypi.yaml on cloudflyer-project/cloudflyer-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cfsolver-0.1.0.tar.gz -
Subject digest:
29440e68f38ccca601dff2992e7a8929b4f692a1d5737e59b78af9807f0248ec - Sigstore transparency entry: 775697989
- Sigstore integration time:
-
Permalink:
cloudflyer-project/cloudflyer-python-sdk@b1671d8337c58cad9f73ca0286b766ecee34209f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cloudflyer-project
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@b1671d8337c58cad9f73ca0286b766ecee34209f -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file cfsolver-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cfsolver-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b66605aaf786c720669aa1e99c8b87f474ccbd8e3f1b3ff4b9bc6d54dcabf0aa
|
|
| MD5 |
5b0d975740a9f639d33eb48ac4c877db
|
|
| BLAKE2b-256 |
f436012ee2070bba4c39f744d6e227b7b4cb7ff4afe16c93b1654580a05ef58a
|
Provenance
The following attestation bundles were made for cfsolver-0.1.0-py3-none-any.whl:
Publisher:
pypi.yaml on cloudflyer-project/cloudflyer-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cfsolver-0.1.0-py3-none-any.whl -
Subject digest:
b66605aaf786c720669aa1e99c8b87f474ccbd8e3f1b3ff4b9bc6d54dcabf0aa - Sigstore transparency entry: 775697990
- Sigstore integration time:
-
Permalink:
cloudflyer-project/cloudflyer-python-sdk@b1671d8337c58cad9f73ca0286b766ecee34209f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cloudflyer-project
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@b1671d8337c58cad9f73ca0286b766ecee34209f -
Trigger Event:
workflow_dispatch
-
Statement type: