TON Sites
TON Sites are web services that support an HTTP interface. They use RLDP datagrams over the ADNL protocol to transfer HTTP queries and responses, residing entirely within the TON Network. A TON Site is identified by its ADNL address rather than an IP address, so no IP address appears in the URL or at the HTTP layer.
How TON Sites work
Section titled “How TON Sites work”When a user visits a TON Site:
- The TON Proxy client accepts an HTTP request from an ordinary web browser.
- The proxy resolves the target address, either through TON DNS (for human-readable
.tondomains) or directly from a known ADNL address. - The HTTP request is encapsulated in RLDP datagrams and sent through the ADNL network to the TON Site’s abstract address.
- The TON Site processes the request and returns an HTTP response.
ADNL address as identity
Section titled “ADNL address as identity”Every TON Site is identified by a 256-bit ADNL abstract address derived from its public key. Because the ADNL address is independent of the server’s IP address, a site is not tied to any particular server location.
TON Site hosting
Section titled “TON Site hosting”Hosting a TON Site requires a reverse proxy that accepts inbound ADNL connections and forwards HTTP requests to a local web server. Two implementations are available: rldp-http-proxy from the TON monorepo (manual key generation) and tonutils-reverse-proxy (automatic key generation and domain linking). For setup instructions, see How to set up a reverse proxy.
TON Sites can serve either dynamic content via a conventional HTTP server or static content stored as a bag in TON Storage, with the storage gateway resolving .bag hostnames directly.
Domain name resolution
Section titled “Domain name resolution”TON DNS
Section titled “TON DNS”A dns_adnl_address record in TON DNS maps a .ton domain name to the ADNL address of the TON Site. The proxy client resolves this record and connects to the correct ADNL address. See TON DNS for the full record type specification.
Direct access via ADNL address
Section titled “Direct access via ADNL address”TON Sites can also be accessed directly by their ADNL address, without DNS resolution.
Related components
Section titled “Related components”- ADNL: the abstract datagram network layer providing transport for TON Sites.
- RLDP: the reliable large datagram protocol over ADNL for HTTP transfer.
- TON Proxy: bridges HTTP requests from a conventional browser to the ADNL network.
- TON DNS: maps
.tondomains to ADNL addresses. - How to host a TON Site: step-by-step guide to setting up a reverse proxy and linking a domain.