‹ BackHN Continuity

Thread

Self-Hosting on the Dark Web

358 points · 118 comments · mooreds

  1. ivanmontillam · · focus · HN ↗
    What I really love about Onion sites is that if they are big enough, performance engineering really becomes Tor-specific. A few examples:

    - Making assets embedded as base64 (img src the header logo as base64, all CSS should be inline, etc.).

    - Leveraging CSS as much as possible (if you use animations and transitions, use CSS as much as possible for these, avoid JS for them).

    - Make sure your website is mostly rendered on the backend. If you're to have JS, your website should work without it.

    - Security becomes REALLY fun, as in, avoid XSS, CSRF, SQL Injection attacks and any other injections as much as possible.

    As someone summarizes in another comment[0], keep the chattiness as minimal as possible. By chattiness I understand they mean, pack as much data as you can in the same Keep-Alive connection. Avoid making new HTTP requests as much as possible, as each one might get assigned to a new Onion route making things slow.

    If you can ship your website to the browser in a single connection, you've won.

    I've always been impressed by performance of these big Onion sites, they really push the limits of software engineering creativity, given these constraints and nature of Tor.

    --

    [0]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49872320">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49872320

    EDIT: Formatting of bullet points.

    1. boredatoms · · focus · HN ↗
      Are these simply good ideas regardless of tor?
      1. Gigachad · · focus · HN ↗
        Not really. The latency between a client and clearnet sites is tiny, and splitting assets in to separate resources makes caching work better.
        1. someonebaggy · · focus · HN ↗
          Some people live in Australia though
        2. boomlinde · · focus · HN ↗
          Minimizing latency and connection count is only half of the problem, though. To the greatest extent possible not relying on JavaScript, and to the greatest extent possible not relying on third party libraries when you do seems like a good general takeaway.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.