Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Comprehensive Cloudflare platform skill covering Workers, D1, R2, KV, AI, Durable Objects, and security.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/spectrum/configuration.md
1## Origin Types23### Direct IP Origin45Use when origin is a single server with static IP.67**TypeScript SDK:**8```typescript9const app = await client.spectrum.apps.create({10zone_id: 'your-zone-id',11protocol: 'tcp/22',12dns: { type: 'CNAME', name: 'ssh.example.com' },13origin_direct: ['tcp://192.0.2.1:22'],14ip_firewall: true,15tls: 'off',16});17```1819**Terraform:**20```hcl21resource "cloudflare_spectrum_application" "ssh" {22zone_id = var.zone_id23protocol = "tcp/22"2425dns {26type = "CNAME"27name = "ssh.example.com"28}2930origin_direct = ["tcp://192.0.2.1:22"]31ip_firewall = true32tls = "off"33argo_smart_routing = true34}35```3637### CNAME Origin3839Use when origin is a hostname (not static IP). Spectrum resolves DNS dynamically.4041**TypeScript SDK:**42```typescript43const app = await client.spectrum.apps.create({44zone_id: 'your-zone-id',45protocol: 'tcp/3306',46dns: { type: 'CNAME', name: 'db.example.com' },47origin_dns: { name: 'db-primary.internal.example.com' },48origin_port: 3306,49tls: 'full',50});51```5253**Terraform:**54```hcl55resource "cloudflare_spectrum_application" "database" {56zone_id = var.zone_id57protocol = "tcp/3306"5859dns {60type = "CNAME"61name = "db.example.com"62}6364origin_dns {65name = "db-primary.internal.example.com"66}6768origin_port = 330669tls = "full"70argo_smart_routing = true71}72```7374### Load Balancer Origin7576Use for high availability and failover.7778**Terraform:**79```hcl80resource "cloudflare_load_balancer" "game_lb" {81zone_id = var.zone_id82name = "game-lb.example.com"83default_pool_ids = [cloudflare_load_balancer_pool.game_pool.id]84}8586resource "cloudflare_load_balancer_pool" "game_pool" {87name = "game-primary"88origins { name = "game-1"; address = "192.0.2.1" }89monitor = cloudflare_load_balancer_monitor.tcp_monitor.id90}9192resource "cloudflare_load_balancer_monitor" "tcp_monitor" {93type = "tcp"; port = 25565; interval = 60; timeout = 594}9596resource "cloudflare_spectrum_application" "game" {97zone_id = var.zone_id98protocol = "tcp/25565"99dns { type = "CNAME"; name = "game.example.com" }100origin_dns { name = cloudflare_load_balancer.game_lb.name }101origin_port = 25565102}103```104105## TLS Configuration106107| Mode | Description | Use Case | Origin Cert |108|------|-------------|----------|-------------|109| `off` | No TLS | Non-encrypted (SSH, gaming) | No |110| `flexible` | TLS client→CF, plain CF→origin | Testing | No |111| `full` | TLS end-to-end, self-signed OK | Production | Yes (any) |112| `strict` | Full + valid cert verification | Max security | Yes (CA) |113114**Example:**115```typescript116const app = await client.spectrum.apps.create({117zone_id: 'your-zone-id',118protocol: 'tcp/3306',119dns: { type: 'CNAME', name: 'db.example.com' },120origin_direct: ['tcp://192.0.2.1:3306'],121tls: 'strict', // Validates origin certificate122});123```124125## Proxy Protocol126127Forwards real client IP to origin. Origin must support parsing.128129| Version | Protocol | Use Case |130|---------|----------|----------|131| `off` | - | Origin doesn't need client IP |132| `v1` | TCP | Most TCP apps (SSH, databases) |133| `v2` | TCP | High-performance TCP |134| `simple` | UDP | UDP applications |135136**Compatibility:**137- **v1**: HAProxy, nginx, SSH, most databases138- **v2**: HAProxy 1.5+, nginx 1.11+139- **simple**: Cloudflare-specific UDP format140141**Enable:**142```typescript143const app = await client.spectrum.apps.create({144// ...145proxy_protocol: 'v1', // Origin must parse PROXY header146});147```148149**Origin Config (nginx):**150```nginx151stream {152server {153listen 22 proxy_protocol;154proxy_pass backend:22;155}156}157```158159## IP Access Rules160161Enable `ip_firewall: true` then configure zone-level firewall rules.162163```typescript164const app = await client.spectrum.apps.create({165// ...166ip_firewall: true, // Applies zone firewall rules167});168```169170## Port Ranges (Enterprise Only)171172```hcl173resource "cloudflare_spectrum_application" "game_cluster" {174zone_id = var.zone_id175protocol = "tcp/25565-25575"176177dns {178type = "CNAME"179name = "games.example.com"180}181182origin_direct = ["tcp://192.0.2.1"]183184origin_port {185start = 25565186end = 25575187}188}189```190191## See Also192193- [patterns.md](patterns.md) - Protocol-specific examples194- [api.md](api.md) - REST/SDK reference195