Spectrum is a global TCP and UDP proxy running on Cloudflare's edge nodes. It does not terminate the connection in the application-layer sense. However, at Layer 4, Spectrum does terminate the TCP and UDP sockets in both directions. The L4 payloads of TCP segments and UDP datagrams are passed back and forth as-is, without modifications.
This means Spectrum does not inspect, modify, or upgrade application-layer protocols. For example, Spectrum cannot convert an HTTP connection to HTTPS, add HTTP headers, or apply WAF rules to TCP traffic. To add Layer 7 functionality such as CDN or Bot Management, set the application type to HTTP/HTTPS.
For common issues and troubleshooting guidance, refer to Spectrum Troubleshooting.
The application type determines how data travels from the edge to your origin:
- Select TCP/UDP to proxy directly to an IP address, hostname, load balancer, or virtual network.
- Select HTTP/HTTPS to route traffic through Cloudflare's Layer 7 pipeline.
For a TCP application, you can select a Worker origin to send connections to a Worker's connect() handler.
Set traffic_type to worker and origin_worker_id to the immutable 32-character tag assigned to the target Worker. Refer to Route TCP traffic to a Worker for setup instructions.
Worker origins have the following constraints:
- For the TCP beta,
protocolmust specify TCP on a single port. Port ranges are not supported. - Pro and Business zones without Spectrum Enterprise support one Worker-origin application per zone, in addition to their existing plan-supported applications. Free zones are not supported.
- On Pro and Business zones without Spectrum Enterprise, omit
tls. Spectrum does not terminate TLS for these applications. - With Spectrum Enterprise,
tlscan beofforflexible. origin_direct,origin_dns,origin_port,virtual_network_id, Proxy Protocol, and Argo Smart Routing are not supported.
Without TLS termination, Spectrum passes the TCP payload to the Worker. An encrypted service must terminate TLS behind the Worker. With Spectrum Enterprise and tls set to flexible, Spectrum terminates TLS at the edge and sends the decrypted TCP payload to the Worker.
When a Spectrum application is created, it is assigned a unique IPv4 and IPv6 address, or you can provision the application to be IPv6 only. The addresses are not static, and they may change over time. The best way to look up the current addresses is by using DNS. The DNS name of the Spectrum application will always return the IPs currently dedicated to the application.
The addresses are anycasted from all Cloudflare data centers, with the exception of data centers in China.
Spectrum can act as a TCP load balancer in front of an SMTP server but will not act as an intermediary mail server. Instead, Spectrum passes data through to your origin. The client IP shown on mail will be the Cloudflare edge IP. If the mail server requires knowing the true client IP, it should use Proxy Protocol to get the source IP from Cloudflare. Cloudflare recommends enabling Proxy Protocol on applications configured to proxy SMTP.
SMTP servers may perform a series of checks on servers attempting to send messages through it. These checks are intended to filter requests from illegitimate servers.
Messages may be rejected if:
- A reverse DNS lookup on the IP address of the connecting server returns a negative response.
- The reverse DNS lookup produces a different hostname than what was sent in the SMTP
HELO/EHLOmessage. - The reverse DNS lookup produces a different hostname than what is advertised in your SMTP server's banner.
- The result of a reverse DNS lookup does not match a corresponding forward DNS lookup.
Spectrum applications do not have reverse DNS entries.
Additionally, SMTP servers may perform a DNS lookup to find the MX records for a domain. Messages from your server may be rejected if an MX record for your domain is associated with a Spectrum application, as the IP address of server will not match the Spectrum IP address.
Cloudflare supports all TCP ports.
Spectrum applications can be configured to proxy traffic on ranges of ports.
Worker origins do not support port ranges. Configure a single TCP port instead.
For direct origins:
{
"protocol": "tcp/1000-2000",
"dns": {
"type": "CNAME",
"name": "range.example.com"
},
"origin_direct": ["tcp://192.0.2.1:3000-4000"]
}For DNS origins:
{
"protocol": "tcp/1000-2000",
"dns": {
"type": "CNAME",
"name": "range.example.com"
},
"origin_dns": {
"name": "origin.example.com",
"ttl": 1200
},
"origin_port": "3000-4000"
}The number of ports in an origin port range must match the number of ports specified in the protocol field.
Connections to a port within a port range at the edge will be proxied to the equivalent port offset in the origin range.
For example, in the configurations above, a connection to range.example.com:1005 would be proxied to port 3005 on the origin.
If IP Access rules are enabled for a Spectrum application, Cloudflare will respect the IP Access rules configured for that domain. Cloudflare only respects rules created for specific IP addresses, IP blocks, countries, or ASNs for Spectrum applications. Spectrum will also only respect rules created with the actions allow or block.
IP Access Rules are off by default for new TCP and UDP applications, whether you create them in the dashboard or through the API with ip_firewall omitted. To turn them on, edit the application in the dashboard and turn on IP Access Rules under Advanced Options, or set ip_firewall to true through the API. The ip_firewall setting applies only to TCP and UDP applications. The API rejects ip_firewall: true for HTTP and HTTPS applications, and the dashboard does not show the switch for them.
Once Argo Smart Routing is enabled for your application, traffic will automatically be routed through the fastest and most reliable network path available. Argo Smart Routing is available for TCP and UDP (beta) applications.
Spectrum applications can route origin_direct traffic to a private origin through a Cloudflare Tunnel virtual network. Set virtual_network_id on the application to the ID of the virtual network that the origin IP is routable within. Traffic to the application is delivered through the connector associated with that virtual network — typically a Cloudflare Tunnel or a Cloudflare WAN (formerly Magic WAN) connection.
To create the virtual network and attach a route covering your origin IP, refer to Manage virtual networks and Connect an IP/CIDR.
The following restrictions apply when virtual_network_id is set:
- Application type must be TCP or UDP. HTTP/HTTPS applications do not support virtual network origins.
- The origin must be specified with
origin_direct. Hostname origins (origin_dns) are not supported. origin_directmust contain exactly one address. Multiple addresses are not supported.- The origin port must be a single port. Port ranges are not supported.
- The origin IP must be routable within the specified virtual network. The virtual network must already have a route covering the IP.
- Proxy Protocol is not supported.
proxy_protocolmust be set tooff.
For the validation error codes returned when these constraints are violated, refer to Error codes.
Spectrum virtual network origins are for TCP and UDP traffic only. For HTTP/HTTPS traffic to private origins, use Application Services for Private Origins, which provides WAF, CDN caching, and the full Cloudflare proxy stack.
If you enable Edge TLS Termination for a Spectrum application, Cloudflare will encrypt traffic for the application at the Edge. The Edge TLS Termination toggle applies only to TCP applications.
Spectrum offers three modes of TLS termination: 'Flexible', 'Full', and 'Full (Strict)'.
'Flexible' enables termination of the client connection at the edge, but does not enable TLS from Cloudflare to your origin. Traffic will be sent over an encrypted connection from the client to Cloudflare, but not from Cloudflare to the origin.
'Full' specifies that traffic from Cloudflare to the origin will also be encrypted but without certificate validation. When set to 'Full (Strict)', traffic from Cloudflare to the origin will also be encrypted with strict validation of the origin certificate.
TLS versions supported by Spectrum include TLS 1.1, TLS 1.2, and TLS 1.3.
You can manage this through the Spectrum app at the Cloudflare dashboard, or using the Spectrum API endpoint.
Below are the cipher suites Cloudflare presents to origins during an SSL/TLS handshake. For cipher suites supported at our edge or presented to browsers and other user agents, refer to Cipher suites.
The cipher suites below are ordered based on how they appear in the ClientHello, communicating our preference to the origin. Customers do not have the ability to modify the ciphers used by Spectrum.
| OpenSSL Name | TLS 1.1 | TLS 1.2 | TLS 1.3 |
|---|---|---|---|
| AEAD-AES128-GCM-SHA2561 | ❌ | ❌ | ✅ |
| AEAD-AES256-GCM-SHA3841 | ❌ | ❌ | ✅ |
| AEAD-CHACHA20-POLY1305-SHA2561 | ❌ | ❌ | ✅ |
| ECDHE-ECDSA-AES128-GCM-SHA256 | ❌ | ✅ | ❌ |
| ECDHE-RSA-AES128-GCM-SHA256 | ❌ | ✅ | ❌ |
| ECDHE-RSA-AES128-SHA | ✅ | ✅ | ❌ |
| AES128-GCM-SHA256 | ❌ | ✅ | ❌ |
| AES128-SHA | ✅ | ✅ | ❌ |
| AES256-SHA | ✅ | ✅ | ❌ |
-
Although TLS 1.3 uses the same cipher suite space as previous versions of TLS, TLS 1.3 cipher suites are defined differently, only specifying the symmetric ciphers, and cannot be used with TLS 1.2. Similarly, TLS 1.2 and lower cipher suites cannot be used with TLS 1.3 (RFC 8446 ↗︎). BoringSSL also hard-codes cipher preferences in this order for TLS 1.3. Refer to TLS 1.3 cipher suites for details. ↩ ↩2 ↩3