🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

cloudflarify

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudflarify

A Python wrapper to run Cloudflare tunnels programmatically

1.0.0
PyPI
Maintainers
1

Cloudflarify

A Python package to easily start and manage Cloudflare Tunnels for exposing local services securely.

Features

Auto-downloads & updates the cloudflared binary
Supports Windows, Linux, and macOS
Works with Cloudflare account tunnels or TryCloudflare
Asynchronous & efficient (aiohttp based)
Automatic exponential backoff for stable connections

Installation

Install via PyPI:

pip install cloudflarify

Usage

Basic Usage (TryCloudflare)

import asyncio
from cloudflarify import start_tunnel

async def main():
    tunnel_url = await start_tunnel(app_port=5000)
    print(f"Tunnel is live at: {tunnel_url}")

asyncio.run(main())

With Cloudflare Account Tunnel

asyncio.run(start_tunnel(app_port=5000, tunnel_key="YOUR_TUNNEL_KEY"))

Using a Config File

asyncio.run(start_tunnel(config_file="path/to/config.yml"))

Running a Flask App with Cloudflare Tunnel

from flask import Flask
import asyncio
from cloudflarify import start_tunnel

port = 5000
app = Flask(__name__)

@app.route("/")
def home():
    return "Hello, Cloudflare Tunnel!"

if __name__ == "__main__":
    asyncio.run(start_tunnel(app_port=port))  # Start tunnel
    app.run(port=port)  # Start Flask app

Requirements

  • Python 3.7+
  • aiohttp, tqdm

Acknowledgement

This project was inspired by flask-cloudflared.

License

This project is MIT licensed.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts