Skip to main content

with-cloudflared

With-cloudflared provides a context manager to start and stop cloudflared. Cloudflare Tunnel provides you with a secure way to connect your resources to Cloudflare without a publicly routable IP address. This is useful for development and testing, as well as for production use cases. See the Cloudflare Tunnel documentation for more information.

Installation

pip install with-cloudflared

Usage

import uvicorn
from fastapi import FastAPI
from with_cloudflared import cloudflared

app = FastAPI()

@app.get("/")
def read_root():
    return {"Hello": "World"}

if __name__ == "__main__":
    port = 8000
    with cloudflared(port=port) as cloudflared_address:
        print(f" * Running on {cloudflared_address}")
        uvicorn.run(app, port=port)

This will start cloudflared and then start the FastAPI server. The app will be publicly available at the cloudflared address e.g. something like https://rp-son-configured-army.trycloudflare.com.

The first time you run this it will take a few seconds to download and start cloudflared. Subsequent runs will be much faster.

Metadata

Release files for with-cloudflared 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for with-cloudflared 0.1.0
File Size Uploaded Provenance
with_cloudflared-0.1.0.tar.gz 4.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for with-cloudflared 0.1.0
File Interpreter ABI Platform
with_cloudflared-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.2 kB

Release files / with_cloudflared-0.1.0.tar.gz

Download URL with_cloudflared-0.1.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6a934d1a95fd5be5c4506def73f8c569c817902feb4e2ac13e9446198097a0e9
BLAKE2b-256 checksum
How to use checksums
9d791f0f53b861f46c1031212f1a899b32024342d466598e1afd2d0ef9673849
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.2

Release files / with_cloudflared-0.1.0-py3-none-any.whl

Download URL with_cloudflared-0.1.0-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d90c0d1e7cf6e2116becf50c6eddab07ab148b40ca702ba8506e7fe09222b149
BLAKE2b-256 checksum
How to use checksums
8f81554979cf3b18b87dcbcfdbca89f184997324528b5dfb4d2e7a2802051b8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.2

Security for with-cloudflared 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page