Tunnel
Cloudflare Tunnel is a service that creates secure, encrypted connections between local services and Cloudflare’s global network, enabling remote access without directly exposing infrastructure to the internet. In the context of the Cortex API, Tunnel allows authorized users to access the API from remote locations while maintaining the service on a private network. This approach reduces security surface area by eliminating the need for inbound firewall rules or public IP addresses.
Installation on WSL2
cloudflared, the command-line tool that powers Cloudflare Tunnel, can be installed on Windows Subsystem for Linux 2 (WSL2). The installation process involves downloading the appropriate binary from Cloudflare’s releases, extracting it to a location in the system PATH, and verifying the installation by checking the version. Once installed, cloudflared requires authentication with a Cloudflare account before it can establish tunnel connections.
Configuration for Cortex API
After installation, cloudflared must be configured to route traffic from a Cloudflare domain to the local Cortex API service. Configuration is typically managed through a YAML file that specifies the local service address (such as localhost:8000) and the public hostname through which the API should be accessed. The tunnel is then started with cloudflared, which establishes the connection to Cloudflare’s infrastructure and begins accepting traffic destined for the configured domain.