### Build FlareTunnel from Source (Bash) Source: https://context7.com/mordavid/flaretunnel/llms.txt This bash script demonstrates how to clone the FlareTunnel repository, build the executable for the current platform, and provides examples for cross-compiling for different operating systems. It also shows the output of the build script and quick start commands. ```bash # Clone and build for current platform git clone https://github.com/MorDavid/FlareTunnel.git cd FlareTunnel go build -o FlareTunnel FlareTunnel.go # Or use the build script chmod +x build.sh ./build.sh # Output: # Building FlareTunnel... # Downloading dependencies... # Building for current platform... # ✅ Build complete: ./flaretunnel # # Binary size: 8.2M # # Quick start: # ./flaretunnel config # ./flaretunnel create --count 5 # ./flaretunnel list --verbose # ./flaretunnel tunnel --verbose # Cross-compile manually GOOS=windows GOARCH=amd64 go build -o flaretunnel.exe FlareTunnel.go GOOS=linux GOARCH=amd64 go build -o flaretunnel-linux FlareTunnel.go GOOS=darwin GOARCH=arm64 go build -o flaretunnel-macos FlareTunnel.go ``` -------------------------------- ### Python Client Usage with Requests Source: https://context7.com/mordavid/flaretunnel/llms.txt Demonstrates how to use FlareTunnel as a proxy within Python applications using the 'requests' library. It covers making GET, POST, and requests with custom headers, and includes examples of IP rotation and using a session for connection pooling. Requires 'requests' and 'urllib3' to be installed. ```python #!/usr/bin/env python3 """ FlareTunnel Python Client Example Prerequisites: pip install requests Make sure proxy is running: ./FlareTunnel tunnel --verbose """ import requests import urllib3 import time # Disable SSL warnings (required for SSL interception) urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) # FlareTunnel proxy configuration proxies = { 'http': 'http://127.0.0.1:8080', 'https': 'http://127.0.0.1:8080' } # Test 1: Simple GET request response = requests.get( "https://httpbin.org/get?test=123", proxies=proxies, verify=False, # Required for SSL interception timeout=10 ) print(f"Status: {response.status_code}") print(f"Origin IP: {response.json()['origin']}") # Output: # Status: 200 # Origin IP: 104.18.32.100 # Test 2: POST request with JSON body response = requests.post( "https://httpbin.org/post", json={ "username": "testuser", "action": "login", "timestamp": time.time() }, proxies=proxies, verify=False, timeout=10 ) print(f"Status: {response.status_code}") print(f"Received JSON: {response.json()['json']}") # Output: # Status: 200 # Received JSON: {'username': 'testuser', 'action': 'login', 'timestamp': 1705312800.123} # Test 3: Custom headers response = requests.get( "https://httpbin.org/headers", headers={ "X-Custom-Header": "FlareTunnel-Test", "User-Agent": "FlareTunnel/1.0" }, proxies=proxies, verify=False, timeout=10 ) headers_received = response.json()['headers'] print(f"Custom Header: {headers_received.get('X-Custom-Header')}") # Output: # Custom Header: FlareTunnel-Test # Test 4: IP rotation check (multiple requests) ips = set() for i in range(5): response = requests.get( "https://httpbin.org/ip", proxies=proxies, verify=False, timeout=10 ) ip = response.json()['origin'] ips.add(ip) print(f"Request {i+1}: {ip}") time.sleep(0.5) print(f"Unique IPs observed: {len(ips)}") # Output: # Request 1: 104.18.32.100 # Request 2: 104.18.33.101 # Request 3: 104.18.34.102 # Request 4: 104.18.32.100 # Request 5: 104.18.33.101 # Unique IPs observed: 3 # Using requests.Session for connection pooling session = requests.Session() session.proxies = proxies session.verify = False for _ in range(10): response = session.get("https://example.com") print(f"Status: {response.status_code}, Size: {len(response.content)} bytes") ``` -------------------------------- ### Build FlareTunnel from Source (Bash) Source: https://github.com/mordavid/flaretunnel/blob/main/README.md This command clones the FlareTunnel repository and builds the executable from the Go source code. It requires Git and Go (version 1.19+) to be installed. ```bash git clone https://github.com/MorDavid/FlareTunnel.git cd FlareTunnel go build -o FlareTunnel FlareTunnel.go ``` -------------------------------- ### Start FlareTunnel Local Proxy Server (Bash) Source: https://github.com/mordavid/flaretunnel/blob/main/README.md This command starts the local proxy server, which listens on `localhost:8080` by default. Client traffic is then routed through this local proxy to the deployed Cloudflare Workers. ```bash ./FlareTunnel tunnel ``` -------------------------------- ### Curl Command-Line Usage with Proxy Source: https://context7.com/mordavid/flaretunnel/llms.txt Provides examples of using FlareTunnel as a proxy with the curl command-line tool. It demonstrates basic HTTP and HTTPS requests, POST requests with JSON data, setting custom headers, downloading files, and using environment variables for proxy configuration. The '-k' flag is used for SSL interception. ```bash # Basic HTTP request through proxy curl -x http://127.0.0.1:8080 http://httpbin.org/ip # Output: {"origin": "104.18.32.100"} # HTTPS request (with insecure flag for SSL interception) curl -x http://127.0.0.1:8080 -k https://httpbin.org/ip # Output: {"origin": "104.18.32.100"} # POST request with JSON data curl -x http://127.0.0.1:8080 -k \ -X POST \ -H "Content-Type: application/json" \ -d '{"key": "value"}' \ https://httpbin.org/post # Custom headers curl -x http://127.0.0.1:8080 -k \ -H "X-Custom-Header: test" \ -H "User-Agent: MyApp/1.0" \ https://httpbin.org/headers # Download file through proxy curl -x http://127.0.0.1:8080 -k -O https://example.com/file.zip # Using environment variables export http_proxy=http://127.0.0.1:8080 export https_proxy=http://127.0.0.1:8080 curl -k https://httpbin.org/ip # Verbose output to see proxy connection curl -x http://127.0.0.1:8080 -k -v https://httpbin.org/ip 2>&1 | head -20 ``` -------------------------------- ### Start FlareTunnel Proxy Server Source: https://context7.com/mordavid/flaretunnel/llms.txt Starts a local HTTP/HTTPS proxy server that routes traffic through Cloudflare Workers. It supports various configurations like worker selection, rotation modes, SSL interception, blacklisting, and upstream proxy chaining. ```bash # Basic tunnel with verbose logging ./FlareTunnel tunnel --verbose # Use specific workers only (by index) ./FlareTunnel tunnel --workers 0,1,2 # Use worker range ./FlareTunnel tunnel --workers 0-4 # Random rotation mode (default is round-robin) ./FlareTunnel tunnel --mode random # Custom port and host ./FlareTunnel tunnel --host 0.0.0.0 --port 9090 # Chain with upstream proxy (e.g., Burp Suite) ./FlareTunnel tunnel --upstream-proxy http://127.0.0.1:8080 --port 9090 # Use aggressive blacklist ./FlareTunnel tunnel --blacklist blacklist-aggressive.txt # Disable SSL interception (HTTPS passthrough) ./FlareTunnel tunnel --no-ssl-intercept # Add inline block patterns ./FlareTunnel tunnel --block "google-analytics.com" --block "facebook.com" # Full example with multiple options ./FlareTunnel tunnel \ --host 127.0.0.1 \ --port 8080 \ --workers 0-2 \ --mode round-robin \ --blacklist blacklist.txt \ --verbose ``` -------------------------------- ### Export FlareTunnel Configuration Source: https://context7.com/mordavid/flaretunnel/llms.txt Exports the current FlareTunnel configuration, including account credentials, to a JSON file. This is useful for backing up your setup or migrating it to another machine. The output file contains sensitive API tokens and should be kept secure. ```bash # Export configuration ./FlareTunnel export --output my_backup.json ``` -------------------------------- ### Browser Proxy Configuration Source: https://context7.com/mordavid/flaretunnel/llms.txt Instructions for configuring web browsers to use FlareTunnel as a proxy. It details manual proxy settings for HTTP and HTTPS, and provides steps for installing the FlareTunnel CA certificate to avoid SSL warnings. Also includes specific 'about:config' settings for Firefox. ```text # Manual proxy configuration for any browser: HTTP Proxy: 127.0.0.1 Port: 8080 HTTPS Proxy: 127.0.0.1 Port: 8080 # For HTTPS without certificate warnings, install the CA certificate: # File: flaretunnel_ca.crt (generated on first tunnel start) # # Installation: # - Chrome: Settings → Privacy → Security → Manage certificates → Import # - Firefox: Settings → Privacy → View Certificates → Import # - macOS: Double-click .crt file → Add to Keychain → Trust Always # - Windows: Double-click .crt file → Install Certificate → Trusted Root # Firefox about:config settings for programmatic setup: # network.proxy.type = 1 # network.proxy.http = 127.0.0.1 # network.proxy.http_port = 8080 # network.proxy.ssl = 127.0.0.1 # network.proxy.ssl_port = 8080 ``` -------------------------------- ### Configure FlareTunnel Cloudflare API Credentials Source: https://context7.com/mordavid/flaretunnel/llms.txt Sets up Cloudflare API credentials for FlareTunnel. This interactive wizard guides users through obtaining and entering API tokens and Account IDs for one or more Cloudflare accounts to increase the daily request quota. The configuration is saved to 'flaretunnel.json'. ```bash # Start interactive configuration ./FlareTunnel config # Example interaction: # ====================================================================== # FlareTunnel Multi-Account Configuration # ====================================================================== # # Getting Cloudflare Credentials: # 1. Sign up at https://cloudflare.com # 2. Go to https://dash.cloudflare.com/profile/api-tokens # 3. Click Create Token - use 'Edit Cloudflare Workers' template # 4. Set account and zone resources to all # 5. Copy the token and Account ID # # Account #1 # ---------------------------------------- # Account name (e.g., 'main', 'backup') [account-1]: main # API token: your-cloudflare-api-token-here # Account ID: your-account-id-here # ✅ Account 'main' added! # # Add another account? (y/N): n # # ✅ Configuration saved! # Config file: flaretunnel.json # Accounts configured: 1 # Total daily quota: 100000 requests # Configuration file format (flaretunnel.json): # { # "accounts": [ # { # "name": "main", # "api_token": "your-cloudflare-api-token", # "account_id": "your-account-id" # } # ] # } ``` -------------------------------- ### Configure FlareTunnel Credentials (Bash) Source: https://github.com/mordavid/flaretunnel/blob/main/README.md This command initiates the configuration process for FlareTunnel, allowing users to set up their Cloudflare API credentials, including Account ID and API Token. It supports managing multiple Cloudflare accounts. ```bash ./FlareTunnel config ``` -------------------------------- ### Import FlareTunnel Configuration Source: https://context7.com/mordavid/flaretunnel/llms.txt Imports FlareTunnel configuration from a JSON file. It can either replace the existing configuration or merge with it, skipping duplicate accounts. This command is essential for restoring backups or adding new accounts. ```bash # Import configuration (replace existing) ./FlareTunnel import --input my_backup.json # Merge with existing configuration (skip duplicates) ./FlareTunnel import --input additional_accounts.json --merge ``` -------------------------------- ### List FlareTunnel Proxies and Test Connectivity (Bash) Source: https://github.com/mordavid/flaretunnel/blob/main/README.md These commands are used for managing and testing the deployed FlareTunnel proxy workers. They allow users to view worker status, response times, and perform general connectivity tests. ```bash # List all workers ./FlareTunnel list # Detailed worker view ./FlareTunnel list --verbose # Check worker response times ./FlareTunnel list --status # Test workers ./FlareTunnel test ``` -------------------------------- ### Create FlareTunnel Proxy Workers (Bash) Source: https://github.com/mordavid/flaretunnel/blob/main/README.md This command deploys new Cloudflare Workers to serve as proxy endpoints. Users can specify the number of workers to create and optionally distribute them across multiple accounts or target a specific account. ```bash # Create 5 new proxy workers ./FlareTunnel create --count 5 # Create 10 workers, auto-distributing across accounts ./FlareTunnel create --count 10 --distribute # Create 5 workers on a specific account named 'main' ./FlareTunnel create --count 5 --account main ``` -------------------------------- ### List Deployed FlareTunnel Workers Source: https://context7.com/mordavid/flaretunnel/llms.txt Displays a list of all deployed FlareTunnel workers, including their account, name, URL, request count, and status. Supports a verbose mode for more detailed information and live status checks. Worker indices can be used to target specific workers for tunneling. ```bash # Basic list ./FlareTunnel list # Output: # +---+---------+----------------------------------+---------------------------------------------+----------+--------+ # | # | ACCOUNT | NAME | URL | REQUESTS | STATUS | # +---+---------+----------------------------------+---------------------------------------------+----------+--------+ # | 0 | main | flaretunnel-1764721536-abcdef | https://flaretunnel-...workers.dev | 1250 | Active | # | 1 | main | flaretunnel-1764721537-ghijkl | https://flaretunnel-...workers.dev | 890 | Active | # +---+---------+----------------------------------+---------------------------------------------+----------+--------+ # # Use worker index with: go run FlareTunnel.go tunnel --workers 0,1,2 --verbose # Verbose mode with live status check ./FlareTunnel list --verbose ``` -------------------------------- ### List FlareTunnel Workers Source: https://context7.com/mordavid/flaretunnel/llms.txt Lists deployed FlareTunnel workers, including their creation timestamp, age, URL, and response time. This command helps in monitoring the status and performance of active tunnels. ```bash ./FlareTunnel list --status ``` -------------------------------- ### Test FlareTunnel Workers Source: https://context7.com/mordavid/flaretunnel/llms.txt Tests the connectivity and IP rotation of all deployed workers by making requests to a specified URL. It reports the success status, origin IP, and the number of unique IP addresses used. ```bash # Default test (uses https://ifconfig.me/ip) ./FlareTunnel test # Test with custom URL ./FlareTunnel test --url https://httpbin.org/ip # Test with POST method ./FlareTunnel test --url https://httpbin.org/post --method POST ``` -------------------------------- ### Cloudflare Worker Script for URL Proxying with CORS Source: https://context7.com/mordavid/flaretunnel/llms.txt This JavaScript Worker script, automatically deployed to Cloudflare, handles URL proxying with CORS support. It extracts the target URL from query parameters, headers, or the path, and then proxies the request, returning the response with appropriate CORS headers. ```javascript // FlareTunnel Worker - URL Redirection Script // Deployed automatically by: ./FlareTunnel create addEventListener('fetch', event => { event.respondWith(handleRequest(event.request)) }) async function handleRequest(request) { const url = new URL(request.url) // Get target URL from: query param > header > path let targetUrl = url.searchParams.get('url') if (!targetUrl) targetUrl = request.headers.get('X-Target-URL') if (!targetUrl && url.pathname !== '/') { const pathUrl = url.pathname.slice(1) if (pathUrl.startsWith('http')) targetUrl = pathUrl } if (!targetUrl) { return new Response(JSON.stringify({ error: 'No target URL specified', usage: { query_param: '?url=https://example.com', header: 'X-Target-URL: https://example.com', path: '/https://example.com' } }), { status: 400, headers: { 'Content-Type': 'application/json' }}) } // Proxy the request const response = await fetch(targetUrl, { method: request.method, headers: request.headers, body: request.body }) // Return with CORS headers const responseHeaders = new Headers(response.headers) responseHeaders.set('Access-Control-Allow-Origin', '*') responseHeaders.set('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS') return new Response(response.body, { status: response.status, headers: responseHeaders }) } // Direct Worker usage examples: // GET: https://worker.subdomain.workers.dev?url=https://httpbin.org/ip // POST: https://worker.subdomain.workers.dev/https://api.example.com/data // Header: X-Target-URL: https://example.com ``` -------------------------------- ### Python HTTP Request with FlareTunnel Proxy Source: https://github.com/mordavid/flaretunnel/blob/main/README.md This Python script demonstrates how to configure the `requests` library to use FlareTunnel's local proxy (`127.0.0.1:8080`). It sends a request to `httpbin.org/ip` and prints the originating IP address, which should be a Cloudflare Worker IP. ```python import requests import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) proxies = { 'http': 'http://127.0.0.1:8080', 'https': 'http://127.0.0.1:8080' } r = requests.get("https://httpbin.org/ip", proxies=proxies, verify=False) print(r.json()['origin']) # Cloudflare Worker IP ``` -------------------------------- ### Cleanup FlareTunnel Workers by Account Source: https://context7.com/mordavid/flaretunnel/llms.txt Command to clean up FlareTunnel workers, allowing specification of a particular account to delete from. It prompts for confirmation before proceeding with the deletion of all workers associated with the specified account. ```bash ./FlareTunnel cleanup --account main # Output: # Delete ALL workers from account 'main'? (y/N): y # Cleaning up account: main # ✓ Deleted: flaretunnel-1764721536-abcdef ``` -------------------------------- ### Cleanup FlareTunnel Workers (Bash) Source: https://github.com/mordavid/flaretunnel/blob/main/README.md This command deletes all deployed Cloudflare Workers associated with the configured accounts. Users can choose to delete workers from all accounts or specify a particular account. ```bash # Delete workers from ALL accounts ./FlareTunnel cleanup # Delete workers from 'main' account only ./FlareTunnel cleanup --account main ``` -------------------------------- ### Cleanup FlareTunnel Workers Source: https://context7.com/mordavid/flaretunnel/llms.txt Deletes all FlareTunnel workers across all configured accounts. The command prompts for confirmation before proceeding with the deletion to prevent accidental data loss. ```bash # Delete all workers from all accounts ./FlareTunnel cleanup ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.