Architecture

Level set understanding of Tunlr and how it works.

Tunlr is a CLI tool that allows users to access environments without having direct access to them. The same CLI tool can be ran in two different modes:

This diagram shows how Tunlr works at a high level:

sequenceDiagram
  actor endUser as End User
  participant tunlrServer as Tunlr Server
  participant tunlrClient as Tunlr Client
  participant localService as Local Service

  tunlrClient->>tunlrServer: Registers with Tunlr Server
  tunlrServer-->>tunlrClient: Tunlr Server assigns hostname https://abc.123.tunlr.link
  endUser->>tunlrServer: Initiates HTTP request to https://abc.123.tunlr.link
  tunlrServer-->>tunlrClient: Forwards HTTP request to Tunlr Client
  tunlrClient-->>localService: Forwards HTTP request to Local Service
  localService-->>tunlrClient: Sends HTTP response
  tunlrClient-->>tunlrServer: Forwards HTTP response
  tunlrServer-->>endUser: Sends HTTP response

Server

Tunlr server is a stateless, highly scalable HTTP server. Clients connect to the server and wait for requests from end users. End users send requests to the server, the server routes their request to a client, and the server returns the response from a client.

Tunlr server most have a DNS domain delegated to it and be reachable directly from Tunlr Clients. A valid SSL/TLS certificate is highly recommended.

Client

Tunlr client is a local proxy provider. The client connects to a server, waits for requests, and forwards them to local targets that it can reach. The Tunlr Client does not need be accessible externally, but it must be able to connect to the Tunlr Server.