docs/TOR-INTEGRATION.md
Tor-by-default integration (scaffold)
Overview
Key pieces
Drop‑in steps
Build or obtain a small Tor framework
Add the framework to Xcode targets
Frameworks/. The project is prewired in project.yml to link/embed Frameworks/tor-nolzma.xcframework (rename yours to match, or update the path).Wire Tor bootstrap in TorManager.startTor()
Tor is present (iCepa API), it starts TORThread directly.dlopen) of a bundled framework binary named tor-nolzma.framework/tor-nolzma (or Tor.framework/Tor), resolves tor_run_main, and launches Tor on a background thread.TorManager writes a torrc and then probes 127.0.0.1:39050 until ready.Verify networking
Optional macOS optimization
torrc template The generated torrc (under Application Support/bitchat/tor/torrc) is:
DataDirectory <AppSupport>/bitchat/tor ClientOnly 1 SOCKSPort 127.0.0.1:39050 ControlPort 127.0.0.1:39051 CookieAuthentication 1 AvoidDiskWrites 1 MaxClientCircuitsPending 8
Dev bypass (local only)
Notes