Skip to content

feat(ton): add TON Sites support - #34

Open
TONresistor wants to merge 3 commits into
solardev-xyz:mainfrom
TONresistor:tonsite
Open

feat(ton): add TON Sites support#34
TONresistor wants to merge 3 commits into
solardev-xyz:mainfrom
TONresistor:tonsite

Conversation

@TONresistor

Copy link
Copy Markdown
Contributor

Adds navigation to .ton, .adnl, .bag, and .t.me hosts through a
bundled local TON proxy, with a PAC script handling the routing.
Follows the same pattern as the Bee, IPFS, and Radicle integrations.

The three commits split the feature into the daemon lifecycle (state
machine, binary fetch with SHA256 verification, IPC, startTonAtLaunch
setting), the PAC and cert-error wiring (scoped to TON TLDs, shared
TON_SUFFIXES in src/shared/ton-suffixes.js), and the UI (nodes
dropdown section, protocol icon, canonical ton://host/path address
bar rewrite).

The binary comes from
TONresistor/Tonutils-Proxy,
an MIT-only fork of xssnick/tonutils-proxy with the GPL
adnl-tunnel dependency removed. The address bar canonicalises TON
input forms to match the existing bzz:// / ipfs:// / rad://
behaviour. See #16 for the rationale.

Introduce ton-manager, fetch script, IPC channels and build-system
wiring to download and run the bundled tonutils-freedom-cli binary.

The fetch script pins the bundled binaries to SHA256 checksums
published by the TONresistor/Tonutils-Proxy release, preventing
silent binary substitution.
Hook session.defaultSession to the tonManager event stream. When the
proxy starts, install a PAC script that routes *.ton / *.adnl / *.bag /
*.t.me hosts through the loopback proxy and leaves everything else
DIRECT. A certificate-error handler scoped to TON TLDs accepts the
self-signed responses that ADNL Sites produce.

TON_SUFFIXES and isTonHost live in src/shared/ton-suffixes.js as a
single source of truth for the main process.
Add a TON section to the existing nodes dropdown, mirroring the
Bee/IPFS/Radicle structure. The renderer displays the TON icon and
canonicalises the address bar to ton://host/path after any navigation
to a .ton / .adnl / .bag / .t.me host, regardless of user input form.
@meinharrd meinharrd added the enhancement New feature or request label Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants