Skip to main content

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 requests and httpx
  • 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 (default True, set to False to disable completely)
  • on_challenge: Solve only on challenge detection (default True), 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 proxy parameter, while API calls use api_proxy parameter for independent proxy configuration

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cfsolver-0.1.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cfsolver-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

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

Hashes for cfsolver-0.1.0.tar.gz
Algorithm Hash digest
SHA256 29440e68f38ccca601dff2992e7a8929b4f692a1d5737e59b78af9807f0248ec
MD5 df278a09803657ede32b85811a00c867
BLAKE2b-256 23d0c30d27b61b09547316267f883af08d17c0257fd21e5dd1ad881e8f0adb70

See more details on using hashes here.

Provenance

The following attestation bundles were made for cfsolver-0.1.0.tar.gz:

Publisher: pypi.yaml on cloudflyer-project/cloudflyer-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for cfsolver-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b66605aaf786c720669aa1e99c8b87f474ccbd8e3f1b3ff4b9bc6d54dcabf0aa
MD5 5b0d975740a9f639d33eb48ac4c877db
BLAKE2b-256 f436012ee2070bba4c39f744d6e227b7b4cb7ff4afe16c93b1654580a05ef58a

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page