cfdtunnel is a wrapper for cloudflared access tunnel, designed to access multiple tunnels without having to worry about your cloudflared process.
To manage the cloudflared process is tedious and error prone when using multiple tunnels, leading to port conflicts, clients left running for no reason and so on.
This tool automates the following process:
cloudflared access tcp --hostname foo.bar.com --url 127.0.0.1:1234
cloudflared access tcp --hostname foo.bar2.com --url 127.0.0.1:5678
cloudflared access tcp --hostname foo.bar3.com --url 127.0.0.1:xxxxThe easiest way to install it is using Homebrew:
brew tap mmiranda/apps
brew install cfdtunnelIf you prefer, you also can download the latest binary on the release section
Basically this tool takes care of the cloudflared process initialization for you.
- Runs cloudflared based on you config ini file
- Runs the command you want
- Kills the cloudflared proccess at the end
You can use any command on top of cfdtunnel:
cfdtunnel --profile my-profile1 -- kubectl get namespacescfdtunnel --profile my-profile1 -- k9sConfiguration is really simple, you just need to create your profiles in ~/.cfdtunnel/config
Example:
[my-profile1]
host = https://kubernetes.foo.bar.com
port = 1234
env = HTTPS_PROXY=socks5://127.0.0.1:1234
# env = OTHER=value
[my-profile2]
host = sql.foo.bar.com
# port is not necessaryDefining a port is not required, if you don't specify, cfdtunnel will launch the tunnel using the most random port 5555
In case your application demands specific environment variables, cfdtunnel will make sure it is created prior to its execution. You just need to define it on config file as well.
Contributions, issues, and feature requests are welcome!
Give a ⭐️ if you like this project!