Cloudflare Tunnel client (formerly Argo Tunnel)
Go to file
João "Pisco" Fernandes 73a9980f38 TUN-9255: Improve flush on write conditions in http2 tunnel type to match what is done on the edge
## Summary
We have adapted our edge services to better know when they should flush on write. This is an important
feature to ensure response types like Server Side Events are not buffered, and instead are propagated to the eyeball
as soon as possible. This commit implements a similar logic for http2 tunnel protocol that we use in our edge
services. By adding the new events stream header for json `application/x-ndjson` and using the content-length
and transfer-encoding headers as well, following the RFC's:
- https://datatracker.ietf.org/doc/html/rfc7230#section-4.1
- https://datatracker.ietf.org/doc/html/rfc9112#section-6.1

Closes TUN-9255
2025-04-24 11:49:19 +00:00
.github Update semgrep.yml 2024-09-24 21:40:50 -04:00
.mac_resources
.teamcity TUN-8858: update go to 1.22.10 and include quic-go FIPS changes 2025-01-30 03:11:54 -08:00
carrier
cfapi TUN-8281: Run cloudflared query list tunnels/routes endpoint in a paginated way 2024-03-19 16:35:40 +00:00
cfio
cmd/cloudflared chore: fix linter rules 2025-04-01 18:57:55 +01:00
component-tests TUN-8857: remove restriction for using FIPS and PQ 2025-01-30 05:47:07 -08:00
config TUN-8861: Add configuration for active sessions limiter 2025-01-20 11:39:42 +00:00
connection TUN-9255: Improve flush on write conditions in http2 tunnel type to match what is done on the edge 2025-04-24 11:49:19 +00:00
credentials chore: fix linter rules 2025-04-01 18:57:55 +01:00
datagramsession TUN-8692: remove dashes from session id 2024-10-25 05:45:24 -07:00
diagnostic TUN-8914: Create a flags module to group all cloudflared cli flags 2025-02-06 03:30:27 -08:00
edgediscovery chore: Remove h2mux code 2024-10-15 13:10:30 -07:00
features TUN-8855: fix lint issues 2025-01-30 03:53:24 -08:00
fips TUN-8855: Update PQ curve preferences 2025-01-30 05:02:47 -08:00
flow TUN-8861: Rename Session Limiter to Flow Limiter 2025-01-20 06:33:40 -08:00
hello TUN-7590: Remove usages of ioutil 2023-07-17 19:08:38 +00:00
ingress TUN-8861: Add configuration for active sessions limiter 2025-01-20 11:39:42 +00:00
internal/test
ipaccess
logger fix: Use path and filepath operation appropriately 2025-04-01 17:59:43 +01:00
management chore: fix linter rules 2025-04-01 18:57:55 +01:00
metrics TUN-8792: Make diag/system endpoint always return a JSON 2024-12-11 02:48:41 -08:00
mocks TUN-8861: Rename Session Limiter to Flow Limiter 2025-01-20 06:33:40 -08:00
orchestration TUN-8914: Create a flags module to group all cloudflared cli flags 2025-02-06 03:30:27 -08:00
overwatch
packet TUN-8640: Refactor ICMPRouter to support new ICMPResponders 2024-11-27 12:46:08 -08:00
proxy TUN-8861: Rename Session Limiter to Flow Limiter 2025-01-20 06:33:40 -08:00
quic TUN-8861: Rename Session Limiter to Flow Limiter 2025-01-20 06:33:40 -08:00
retry chore: fix linter rules 2025-04-01 18:57:55 +01:00
signal
socks TUN-7590: Remove usages of ioutil 2023-07-17 19:08:38 +00:00
sshgen TUN-8333: Bump go-jose dependency to v4 2024-04-10 09:49:40 -07:00
stream TUN-7545: Add support for full bidirectionally streaming with close signal propagation 2023-07-06 11:54:26 +01:00
supervisor TUN-9007: modify logic to resolve region when the tunnel token has an endpoint field 2025-02-25 19:03:41 +00:00
tlsconfig TUN-7590: Remove usages of ioutil 2023-07-17 19:08:38 +00:00
token TUN-8960: Connect to FED API GW based on the OriginCert's endpoint 2025-02-25 17:13:33 +00:00
tracing add: new go-fuzz targets 2024-11-11 20:45:49 +05:30
tunneldns TUN-7590: Remove usages of ioutil 2023-07-17 19:08:38 +00:00
tunnelrpc TUN-8904: Rename Connect Response Flow Rate Limited metadata 2025-01-22 07:23:46 -08:00
tunnelstate TUN-8728: implement diag/tunnel endpoint 2024-11-25 10:43:32 -08:00
validation add: new go-fuzz targets 2024-11-11 20:45:49 +05:30
vendor Bump x/crypto to 0.31.0 2025-02-03 16:08:02 +01:00
watcher TUN-7584: Bump go 1.20.6 2023-07-26 13:52:40 -07:00
websocket
.docker-images
.dockerignore
.gitignore TUN-8708: Bump python min version to 3.10 2024-10-31 13:33:24 -07:00
.golangci.yaml TUN-8866: Add linter to cloudflared repository 2025-01-16 07:02:54 -08:00
build-packages-fips.sh TUN-8858: update go to 1.22.10 and include quic-go FIPS changes 2025-01-30 03:11:54 -08:00
build-packages.sh TUN-8583: change final directory of artifacts 2024-08-05 10:49:20 +01:00
catalog-info.yaml SDLC-3727 - Adding FIPS status to backstage 2025-04-10 16:58:04 +00:00
cfsetup.yaml TUN-9089: Pin go import to v0.30.0, v0.31.0 requires go 1.23 2025-03-06 12:05:24 +00:00
CHANGES.md Release 2025.1.1 2025-01-30 14:48:47 +00:00
check-fips.sh
cloudflared_man_template
cloudflared.wxs Remove extraneous period from Path Environment Variable (#1009) 2023-12-14 16:32:48 +00:00
dev.Dockerfile TUN-8858: update go to 1.22.10 and include quic-go FIPS changes 2025-01-30 03:11:54 -08:00
Dockerfile TUN-9016: update base-debian to v12 2025-02-26 15:54:10 +00:00
Dockerfile.amd64 TUN-9016: update base-debian to v12 2025-02-26 15:54:10 +00:00
Dockerfile.arm64 TUN-9016: update base-debian to v12 2025-02-26 15:54:10 +00:00
fmt-check.sh
github_message.py
github_release.py TUN-8694: Rework release script 2024-10-24 09:43:02 -07:00
go.mod Bump x/crypto to 0.31.0 2025-02-03 16:08:02 +01:00
go.sum Bump x/crypto to 0.31.0 2025-02-03 16:08:02 +01:00
LICENSE
Makefile Use RELEASE_NOTES date instead of build date 2025-04-01 17:52:50 +01:00
postinst.sh
postrm.sh TUN-8290: Remove || true from postrm.sh 2024-03-07 16:22:56 +00:00
README.md chore: Update tunnel configuration link in the readme 2025-04-01 17:53:29 +01:00
RELEASE_NOTES Release 2025.4.0 2025-04-01 20:23:54 +01:00
release_pkgs.py TUN-8842: Add Ubuntu Noble and 'any' debian distributions to release script 2025-01-06 12:09:13 +00:00
wix.json

Cloudflare Tunnel client

Contains the command-line client for Cloudflare Tunnel, a tunneling daemon that proxies traffic from the Cloudflare network to your origins. This daemon sits between Cloudflare network and your origin (e.g. a webserver). Cloudflare attracts client requests and sends them to you via this daemon, without requiring you to poke holes on your firewall --- your origin can remain as closed as possible. Extensive documentation can be found in the Cloudflare Tunnel section of the Cloudflare Docs. All usages related with proxying to your origins are available under cloudflared tunnel help.

You can also use cloudflared to access Tunnel origins (that are protected with cloudflared tunnel) for TCP traffic at Layer 4 (i.e., not HTTP/websocket), which is relevant for use cases such as SSH, RDP, etc. Such usages are available under cloudflared access help.

You can instead use WARP client to access private origins behind Tunnels for Layer 4 traffic without requiring cloudflared access commands on the client side.

Before you get started

Before you use Cloudflare Tunnel, you'll need to complete a few steps in the Cloudflare dashboard: you need to add a website to your Cloudflare account. Note that today it is possible to use Tunnel without a website (e.g. for private routing), but for legacy reasons this requirement is still necessary:

  1. Add a website to Cloudflare
  2. Change your domain nameservers to Cloudflare

Installing cloudflared

Downloads are available as standalone binaries, a Docker image, and Debian, RPM, and Homebrew packages. You can also find releases here on the cloudflared GitHub repository.

User documentation for Cloudflare Tunnel can be found at https://developers.cloudflare.com/cloudflare-one/connections/connect-apps

Creating Tunnels and routing traffic

Once installed, you can authenticate cloudflared into your Cloudflare account and begin creating Tunnels to serve traffic to your origins.

TryCloudflare

Want to test Cloudflare Tunnel before adding a website to Cloudflare? You can do so with TryCloudflare using the documentation available here.

Deprecated versions

Cloudflare currently supports versions of cloudflared that are within one year of the most recent release. Breaking changes unrelated to feature availability may be introduced that will impact versions released more than one year ago. You can read more about upgrading cloudflared in our developer documentation.

For example, as of January 2023 Cloudflare will support cloudflared version 2023.1.1 to cloudflared 2022.1.1.

Development

Requirements

Build

To build cloudflared locally run make cloudflared

Test

To locally run the tests run make test

Linting

To format the code and keep a good code quality use make fmt and make lint

Mocks

After changes on interfaces you might need to regenerate the mocks, so run make mock