Skip to Content
OpenFlare
GuidesDeploymentReferenceArchitectureChangelog

System Architecture

OpenFlare comprises the Server control plane, the OpenFlare Edge data plane, standalone OpenFlare DNS authoritative nodes, native Rust tunnel components (openflare-relay and openflared), and the admin console frontend. For edge synchronization and runtime internals, see OpenFlare Edge Architecture Design.

Data Plane Traffic Paths

OpenFlare supports four core data-plane traffic paths:

1. Standard Reverse Proxy Path

Browser
  | HTTPS / HTTP
  v
OpenFlare Edge (TLS / WAF / PoW / Rate Limit / EdgeCache / Origin Error Page)
  | HTTP / HTTPS
  v
Origin Server (public or private upstream)

2. L7 Intranet Tunnel Path (Edge + Relay Gateway)

Browser
  | HTTPS / HTTP / WS
  v
OpenFlare Edge (tunnel-routing.v1, TLS / WAF / PoW)
  | HTTP/WS (X-OpenFlare-Gateway-Auth, nearest healthy relay)
  v
openflare-relay Gateway (:8443)
  | Embedded rathole server (Noise :7443 / WebSocket :7444 / TCP)
  v
openflared (embedded rathole client + CIDR SSRF validation)
  |
  v
Internal Service (private HTTP / HTTPS / WS origin)

3. L4 TCP/UDP Intranet Tunnel Path

TCP / UDP Client
  |
  v
openflare-relay (assigned public TCP/UDP port)
  | Embedded rathole encrypted tunnel (Noise / WebSocket / TCP)
  v
openflared (CIDR SSRF validation)
  |
  v
Internal TCP / UDP Target

4. Pages Static Hosting Path

Browser
  | HTTPS / HTTP
  v
OpenFlare Edge (TLS / WAF / PoW / Site Auth)
  |
  +---> [Static serving] local release directory (ETag / Range / SPA Fallback)
  |
  +---> [API proxy] matches api_proxy_path ---> Backend API upstream

Component Responsibilities

ComponentResponsibilitiesDesign Reference
OpenFlare ServerAdmin UI/API, state persistence, sites.v1 and tunnel-routing.v1 compilation, multi-provider DNS pointing and failover, SmartDNS snapshots and quality matrix, Pages bundle storage, access log aggregation, Uptime Kuma sync, and login PoWOpenFlare Edge Architecture Design / SmartDNS System Architecture Design / Multi-Provider DNS Pointing & Failover Design / Edge Observability and Traffic Analytics Architecture / Uptime Kuma Sync Design / Login CAPTCHA Design
OpenFlare EdgeExecutes TLS termination, WAF DAG and OWASP CRS rules, PoW challenges, site auth, TinyUFO caching, Pages serving, origin error pages, and isolated active probingOpenFlare Edge Architecture Design / WAF Orchestration Rule Design / PoW Protection Design / Edge Cache Strategy Design / Pages Static Hosting Design / Origin Error Page Design
OpenFlare DNSStandalone hickory-server and zen-engine authoritative resolver with ECS awareness, sharded RRL, offline snapshot failover, and quality-weighted selectionSmartDNS System Architecture Design / Network Intelligence and Link Quality Architecture
OpenFlare RelayPublic Rust relay embedding rathole server and Relay Gateway (:8443) for L4/L7 forwarding, Edge colocation, draining, and hot updatesTunnel & Intranet Penetration Design
OpenFlaredPrivate Rust connector performing parallel relay RTT probing, Closest-K zone diversity, Make-Before-Break failover, and CIDR SSRF checksTunnel & Intranet Penetration Design

Control & Data Plane Synchronization

1. Snapshot Compilation & Sync Flow

Admin saves config -> compiles sites.v1 / tunnel-routing.v1 / DNS snapshot
                            |
          +-----------------+-----------------+
          | (WebSocket wake or heartbeat)     |
          v                                   v
   [OpenFlare Edge]                [OpenFlare DNS / Relay / OpenFlared]
Pull manifests by SHA-256         Pull authoritative snapshot & tunnel topology
Verify and swap in memory         Reload resolver & rathole sessions in-process

2. Core Data Tables

DomainTables
Sites & routingof_zones, of_zone_domains, of_proxy_routes, of_origins, of_config_versions, of_edge_snapshot_state, of_tls_certificates
Multi-provider DNSof_dns_accounts, of_cf_connections, of_cf_pointing_groups, of_cf_pointing_members
SmartDNS & qualityof_dns_instances, of_dns_policies, of_network_quality_matrix, of_as_topology_edges, of_traceroute_records, of_probe_targets, of_probe_target_states
Pages hostingof_pages_projects, of_pages_project_sources, of_pages_project_source_runtime, of_pages_deployments, of_pages_deployment_files
Nodes & tunnelsof_nodes, of_node_tags, of_node_tag_bindings, of_node_system_profiles, of_node_cert_deliveries, of_apply_logs, of_tunnel_relay_pools, of_tunnel_relays, of_tunnels, of_tunnel_connectors, of_tunnel_attachments, of_tunnel_services
WAF & securityof_waf_rule_groups, of_waf_ip_groups, of_waf_rule_group_bindings, of_waf_request_whitelist, of_attack_groups, of_pow_policies
Observability (logstore)of_node_access_logs, of_node_metric_snapshots, of_node_ping_records, of_network_quality_samples, of_dns_metric_snapshots, w_user_access_logs

Key Design Decisions

DecisionRationale
Versioned full snapshotsProvides consistent boundaries for checksum validation, atomic in-memory swaps, and cold-start recovery
Agent pull over SSH pushAvoids Server SSH access to nodes and converges reliably across WebSockets and HTTP heartbeats
Separation of Zone domains and route policiesZones govern root domains and certificate bindings while routes share site policies across hostnames
Unified DNS provider adaptersof_dns_accounts powers ACME DNS-01, SmartDNS delegation, and multi-provider DNS pointing
Embedded rathole tunnelsReplaces external frp wrappers with native Noise/WS/TCP fallback, Closest-K failover, and CIDR SSRF guards
Decoupled runtime & control DBEdge and DNS nodes serve from local/memory snapshots even during control-plane outages
Access logs as traffic truthDisallows local edge traffic pre-aggregation so dashboard, node, and Zone analytics share identical server semantics

On this page