Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Flaredantic
Flaredantic is a Python library that simplifies the process of creating Cloudflare tunnels, making it easy to expose your local services to the internet. It's designed to be a user-friendly alternative to ngrok, localtunnel, and similar services, leveraging Cloudflare's robust infrastructure.
While tools like ngrok are great, Cloudflare tunnels offer several advantages:
Flaredantic makes it dead simple to use Cloudflare tunnels in your Python projects!
pip install flaredantic
After installation, you can use either the CLI command flare
or the Python API.
The simplest way to create a tunnel is using the CLI:
# Basic usage - expose port 8080 with verbose output
flare --port 8080 -v
CLI Options:
-p, --port Local port to expose (required)
-t, --timeout Tunnel start timeout in seconds (default: 30)
-v, --verbose Show detailed progress output
from flaredantic import FlareTunnel, FlareConfig
# Create a tunnel for your local server running on port 8000
config = FlareConfig(port=8080)
with FlareTunnel(config) as tunnel:
print(f"Your service is available at: {tunnel.tunnel_url}")
# Your application code here
input("Press Enter to stop the tunnel...")
from flaredantic import FlareTunnel, FlareConfig
from pathlib import Path
# Configure tunnel with custom settings
config = FlareConfig(
port=8080,
bin_dir=Path.home() / ".my-tunnels",
timeout=60,
verbose=True # Enable detailed logging
)
# Create and start tunnel
with FlareTunnel(config) as tunnel:
print(f"Access your service at: {tunnel.tunnel_url}")
input("Press Enter to stop the tunnel...")
from flask import Flask
from flaredantic import FlareTunnel, FlareConfig
import threading
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello, World!'
def run_tunnel():
config = FlareConfig(
port=5000,
verbose=True # Enable logging for debugging
)
with FlareTunnel(config) as tunnel:
print(f"Flask app available at: {tunnel.tunnel_url}")
app.run(port=5000)
if __name__ == '__main__':
threading.Thread(target=run_tunnel).start()
Option | Type | Default | Description |
---|---|---|---|
port | int | Required | Local port to expose |
bin_dir | Path | ~/.flaredantic | Directory for cloudflared binary |
timeout | int | 30 | Tunnel start timeout in seconds |
verbose | bool | False | Show detailed progress and debug output |
For more detailed examples and use cases, check out more examples.
FAQs
A Python library for creating free Cloudflare tunnels with ease
We found that flaredantic demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.