Skip to main content
Deno 2 is finally here 🎉️
Learn more

deno_tor

Tor🧅 request for Deno🦕

How to use it

Start

import { Tor } from "https://deno.land/x/onion/mod.ts" // Import

const tor: Tor = new Tor()

await tor.start() // Start tor

Fetch api

const res: Response = await tor.fetch("https://www.bbcweb3hytmzhn5d532owbu6oqadra5z3ar726vq5kgwwn6aucdccrad.onion", {
  method: "GET",
  // and other fetch options..
}) // BBC Website on darkweb

Warning The tor.fetch API is not parfect as fetch api.

GET API (Deprecated)

const res: Response = await tor.get("https://www.bbcweb3hytmzhn5d532owbu6oqadra5z3ar726vq5kgwwn6aucdccrad.onion") // BBC Website on darkweb

Use ky

import ky from "https://esm.sh/ky"

const text = await ky('https://www.bbcweb3hytmzhn5d532owbu6oqadra5z3ar726vq5kgwwn6aucdccrad.onion', {
  fetch: tor.fetch,
}).text();