Back to documentation

HTTP Tunnel quickstart

Expose a local HTTP service and get its response at a public HTTPS address.

View as Markdown
On this page

Start a local service

You need an Adal Cloud account, a positive traffic balance and Adal CLI v1.0.3 or a later release with HTTP Tunnel support. Download and extract the archive for your OS and architecture.

Use your own test service, or start a server that exposes only a temporary folder with one demonstration file. On macOS or Linux with Python 3:

demo_dir=$(mktemp -d) printf 'Hello from my local service\n' > "$demo_dir/index.html" python3 -m http.server 3000 --bind 127.0.0.1 --directory "$demo_dir"

In PowerShell with Python 3:

$demoDir = Join-Path ([System.IO.Path]::GetTempPath()) ([guid]::NewGuid().ToString()) New-Item -ItemType Directory -Path $demoDir | Out-Null Set-Content -Path (Join-Path $demoDir 'index.html') -Value 'Hello from my local service' py -3 -m http.server 3000 --bind 127.0.0.1 --directory $demoDir

Create and connect the tunnel

  1. In Tunnels, select Create tunnel. Enter a Name, choose an available region and set Endpoint URL to http://127.0.0.1:3000. Keep the tunnel enabled.

    In Endpoint URL, enter the base URL of the service. Adal CLI appends the path and query string from the incoming request. For example, to reach https://adal.cloud/ru/docs, set the endpoint to https://adal.cloud and send the request to https://TUNNEL_ADDRESS.se.adal.cloud/ru/docs. If the endpoint URL includes a path, CLI uses it as a prefix. A request to the tunnel root appends / to that prefix.

  2. Open CLI token in the tunnel card. Create a token with the desired lifetime and copy it. The secret is shown once.

  3. In another terminal, open the directory containing the extracted CLI and run one of these commands. Substitute the tunnel token.

./adal-cli --token '<TUNNEL_TOKEN>'
.\adal-cli.exe --token '<TUNNEL_TOKEN>'

Check the public response

Wait for the client to connect and select Refresh state in the tunnel card and check Online. Copy the public HTTPS address from the card. Replace the example hostname in the command:

curl -i 'https://TUNNEL_ADDRESS.se.adal.cloud/'

In PowerShell, use curl.exe -i 'https://TUNNEL_ADDRESS.se.adal.cloud/'. Expect HTTP 200 and Hello from my local service. The response comes from your local application in the same HTTP exchange. In Tunnels → Requests, open the journal entry to see the status and transfer outcome.

The demo address is public while the tunnel is active. Expose only a service meant to receive external requests. Stop the CLI with Ctrl+C and disable the tunnel when you finish. To use it again, enable it and start the client with a valid token.

Configuration and troubleshooting · Journal and statuses · HTTP data

Related documentation