My question: Is it possible to execute a command at the time you click âSendâ?
Details (like screenshots):
I have a number of API calls that I typically use curl for - they require pre-pending the curl with a binary and action.
For example:
cloudflared access curl https://my-api-server/api/endpoint
The requirement stems from using a Cloudflare zero-trust/remote access solution called Cloudflare Access to connect to a host via the command line without specifying a global proxy within the operating system (which also isnât possible) - the binary is known as cloudflared (or Cloudflare Tunnel).
Per Cloudflareâs documentation:
Cloudflareâs cloudflared command-line tool allows you to interact with endpoints protected by Cloudflare Access. You can use cloudflared to interact with a protected applicationâs API.
While this option is technically forcing an authenticated proxy, itâs not implemented as a traditional proxy would be - itâs not possible to just specify a proxy URL and port (i.e. https://myproxy.company.com:8080) in this particular case.
More details are available here â Cloudflare Zero Trust - Authenticate a Session from the Command Line
Also - when running âcloudflared accessâ the first time, the user is redirected to a web page that will issue a challenge for credentials or request the user authorize the session at which point cloudflared generates an authentication token that is used for future requests until the token expires.
This would be similar in nature to the âTelnet command or local proxyâ option found in PuTTY.
I wasnât able to find any documentation on this. Perhaps Iâm missing something?
Thanks in advance!