https://github.com/nakasyou/deno_tor
Tor🧅 request for Deno🦕
https://github.com/nakasyou/deno_tor
deno javascript onion tor typescript
Last synced: 3 months ago
JSON representation
Tor🧅 request for Deno🦕
- Host: GitHub
- URL: https://github.com/nakasyou/deno_tor
- Owner: nakasyou
- License: mit
- Created: 2023-05-22T01:16:32.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-27T05:36:49.000Z (about 3 years ago)
- Last Synced: 2025-04-08T15:16:08.856Z (about 1 year ago)
- Topics: deno, javascript, onion, tor, typescript
- Language: TypeScript
- Homepage: https://deno.land/x/onion
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deno_tor
Tor🧅 request for Deno🦕
## How to use it
### Start
```ts
import { Tor } from "https://deno.land/x/onion/mod.ts" // Import
const tor: Tor = new Tor()
await tor.start() // Start tor
```
### Fetch api
```ts
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](https://developer.mozilla.org/en-US/docs/Web/API/fetch).
### GET API (Deprecated)
```ts
const res: Response = await tor.get("https://www.bbcweb3hytmzhn5d532owbu6oqadra5z3ar726vq5kgwwn6aucdccrad.onion") // BBC Website on darkweb
```
### Use ky
```ts
import ky from "https://esm.sh/ky"
const text = await ky('https://www.bbcweb3hytmzhn5d532owbu6oqadra5z3ar726vq5kgwwn6aucdccrad.onion', {
fetch: tor.fetch,
}).text();
```