🏠 HOME








What is it Used for?

Such tunnels are useful to test webhooks in local for example.

The client asks an HTTP proxy server to forward the TCP connection to the desired destination, meaning that you can expose your local web server through a public URL.

How?

Using Cloudflare Argo Tunnels. You can find more details here: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide.

Installation

The procedure to create a tunnel is quite simple:

  1. Install the Cloudflare utility on your machine:

    brew install cloudflare/cloudflare/cloudflared
    
  2. Connect the utility to your Cloudflare account with command below and choose the proper A domain that is not part of our infrastructure (i.e. overloop.link):

    cloudflared tunnel login
    
  3. Create a new tunnel in Cloudflare with command below (for ex cloudflared tunnel create overloop-developers-johndoe):

    cloudflared tunnel create <tunnel_name>
    
  4. Add a new CNAME record to redirect the traffic to the tunnel with command below (for ex cloudflared tunnel route dns 0327bfe5-0d20-4e92-8496-08356d5cf660 johndoe to route the traffic to johndoe.yourdomain.com):

    cloudflared tunnel route dns <tunnel_UUID> <cname>
    
  5. Configure your tunnel in ~/.cloudflared/config.yml. For example:

    url: <https://localhost:3000>
    tunnel: 0327bfe5-0d20-4e92-8496-08356d5cf660
    credentials-file: /Users/<MY_USER>/.cloudflared/0327bfe5-0d20-4e92-8496-08356d5cf660.json
    
  6. Start your tunnel with command below (for ex: cloudflared tunnel run 0327bfe5-0d20-4e92-8496-08356d5cf660):

    cloudflared tunnel run <tunnel_UUID>
    
    1. Make sure that you added your certificate to Keychain or you may encounter this error:

      2023-07-11T09:23:35Z ERR  error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: x509: certificate signed by unknown authority" cfRay=7e4cfd203fa9f962-BRU event=1 originService=https://localhost:3000
      2023-07-11T09:23:35Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: x509: certificate signed by unknown authority" connIndex=3 dest=https://johndoe.overloop.link/favicon.ico event=0 ip=198.41.200.23 type=http
      

<aside> <img src="/icons/playback-previous_lightgray.svg" alt="/icons/playback-previous_lightgray.svg" width="40px" /> Bug Fixing 101

</aside>

<aside> <img src="/icons/playback-next_lightgray.svg" alt="/icons/playback-next_lightgray.svg" width="40px" /> Collaborating to this Playbook

</aside>