Skip to content
Discussion options

You must be logged in to vote

Requirements:

npm install got socks-proxy-agent
# Docker Desktop must be installed & running
// tor-proxy-example.mjs
import got from "got";
import { SocksProxyAgent } from "socks-proxy-agent";
import { spawn } from "node:child_process";

const TOR_IMAGE = "osminogin/tor-simple:latest"; // or another maintained Tor proxy image
const TOR_PORT = 9050;
const TOR_ADDR = `socks5h://127.0.0.1:${TOR_PORT}`;

function startTorContainer() {
  // Pull latest image & run in foreground so we can watch logs
  const args = [
    "run",
    "--rm",
    "-i",
    "-a",
    "stdout",
    "-p",
    `127.0.0.1:${TOR_…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sindresorhus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants