{"id":16095643,"url":"https://github.com/rigwild/tor-downloader","last_synced_at":"2025-04-05T20:14:25.996Z","repository":{"id":49280231,"uuid":"284291773","full_name":"rigwild/tor-downloader","owner":"rigwild","description":"📥 Easily download the Tor expert bundle (tor.exe) with GPG signature check","archived":false,"fork":false,"pushed_at":"2021-06-20T16:00:33.000Z","size":51,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-18T19:50:10.546Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rigwild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-01T15:57:39.000Z","updated_at":"2022-03-06T17:23:34.000Z","dependencies_parsed_at":"2022-09-26T16:41:24.369Z","dependency_job_id":null,"html_url":"https://github.com/rigwild/tor-downloader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigwild%2Ftor-downloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigwild%2Ftor-downloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigwild%2Ftor-downloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigwild%2Ftor-downloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rigwild","download_url":"https://codeload.github.com/rigwild/tor-downloader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393573,"owners_count":20931813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T17:07:22.554Z","updated_at":"2025-04-05T20:14:25.945Z","avatar_url":"https://github.com/rigwild.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tor-downloader\n[![Node.js CI](https://github.com/rigwild/tor-downloader/workflows/Node.js%20CI/badge.svg)](https://github.com/rigwild/tor-downloader/actions) [![npm package](https://img.shields.io/npm/v/tor-downloader.svg?logo=npm)](https://www.npmjs.com/package/tor-downloader) ![npm downloads](https://img.shields.io/npm/dw/tor-downloader) ![license](https://img.shields.io/npm/l/tor-downloader?color=blue)\n\n\u003e 📥 Easily download the Tor expert bundle (tor.exe) with GPG signature check\n\nThis package lets you easily download the [Tor expert bundle](https://www.torproject.org/download/tor/) (the portable and headless `tor.exe` binary).\n\nThe GPG signature (sig file, `.asc`) file that comes with the download will be checked using the [Tor Browser Developers signing key](./torBrowserGpgPublicKey.ts) (`EF6E 286D DA85 EA2A 4BA7 DE68 4E2C 6E87 9329 8290`). See [How can I verify Tor Browser's signature?](https://support.torproject.org/tbb/how-to-verify-signature/).\n\nBefore starting the download, it will look for Tor in your specified download directory. If it is there, the Tor expert bundle archive GPG file signature will be checked, if valid, the download will be skipped. If the signature is invalid, the files will be deleted and a new clean download will start.\n\n\n## Why\n\nI used to drop a Powershell command to download the portable Tor binary so I wanted a better alternative.\\\nPlus, with this module I can check the GPG key with [OpenPGP.js](https://github.com/openpgpjs/openpgpjs), without requiring GPG to be installed on the target system.\n\n\n## Install\n\n```\n$ yarn add tor-downloader\n```\n\n\n## Usage\n\n```ts\nimport { downloadTor } from 'tor-downloader'\n\nconst torPaths = await downloadTor({\n  // Default tor-downloader options, all optional\n  torBrowserversion: '9.5.3',\n  architecture: 'win32',\n  torVersion: '0.4.3.6',\n  outputPath: './'\n})\n\n/* =\u003e Tor was downloaded and its GPG signature was checked!\ntorPaths = {\n  downloadURI: string      // Tor expert bundle download URI\n  zipPath: string          // Tor expert bundle zip file path\n  sigPath: string          // Tor expert bundle zip file `.asc` signature path\n  extractedDirPath: string // Path where the Tor expert bundle was extracted to\n  binaryPath: string       // `tor.exe` binary path\n  neededDownload: boolean  // Was a download required ?\n}\n*/\n```\n\n\n## Complete usage example\n\n 1. Download Tor\n 2. Run Tor without logs (`--quiet`) using [execa](https://github.com/sindresorhus/execa)\n 3. Get the running Tor instance route public IP with [node-fetch](https://github.com/node-fetch/node-fetch) using the Tor's SOCKS5 proxy server thanks to [simple-proxy-agent](https://github.com/zjael/simple-proxy-agent)\n 4. Kill Tor\n\n```ts\nimport { downloadTor } from 'tor-downloader'\nimport fetch from 'node-fetch'\nimport execa from 'execa'\nconst ProxyAgent = require('simple-proxy-agent')\n\nconst setup = async () =\u003e {\n  // Download Tor and check its GPG file signature\n  const { binaryPath: tor } = await downloadTor()\n\n  // Run Tor and wait 10 seconds to let it connect to the Tor network\n  const torRunningInstance = execa(tor, ['--quiet'])\n  await new Promise(res =\u003e setTimeout(res, 10000))\n\n  // Get public IP with Tor SOCKS5\n  const torIP = await fetch('https://api.ipify.org/', {\n    agent: new ProxyAgent('socks5://127.0.0.1:9050')\n  }).then(res =\u003e res.text())\n  console.log(`Tor IP: ${torIP}`)\n\n  // Kill Tor\n  torRunningInstance.cancel()\n\n  // Get my public IP\n  const myIP = await fetch('https://api.ipify.org/').then(res =\u003e res.text())\n  console.log(`My public IP: ${myIP}`)\n}\n\nsetup()\n\n// =\u003e\n// Tor IP: 46.19.141.84\n// My public IP: xxx.xxx.xxx.xxx\n```\n\n\n## License\n\n[The MIT license](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frigwild%2Ftor-downloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frigwild%2Ftor-downloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frigwild%2Ftor-downloader/lists"}