This HTML-based tool allows you to stream dummy HTTP requests (via fetch) concurrently to try to trigger Tor circuit rotation. Here is a brief explanation and some suggestions/improvements:
How it works:
You select the number of concurrent streams (1 to 100) with a slider.
Clicking Start will create that number of intervals (timers), each firing every 500ms.
Each interval triggers a fetch to a dummy URL (https://cdn.jsdelivr.net/dummy/hash=RANDOMHASH) with no-cors mode and no-store cache to bypass browser caching.
These requests are meant to go through Tor, making Tor's exit nodes handle new connections and trigger circuit switching.
Click Stop to clear all intervals and stop the requests.
Notes & Improvements:
URL format:
The current URL is https://cdn.jsdelivr.net/dummy/hash=RANDOMHASH. The /dummy/ path likely does not exist on jsDelivr, so every request will 404 or fail silently. Since mode is no-cors, errors are ignored, which is okay if your only goal is to generate network traffic.
You could use a valid URL with a unique query string for better clarity, like:
or a CDN that accepts random query params like Google Fonts or a static site you control.
Browser limits and performance:
Most browsers limit concurrent requests to the same domain (~6 connections normally). Creating 100 intervals calling fetch simultaneously might hit browser throttling and degrade performance drastically. You might want to limit concurrency or choose multiple hosts, or have fewer intervals firing more often.
Cleanup on page unload:
If the user navigates away or closes the tab, clearing intervals is not strictly necessary, but good practice to avoid hanging timers, e.g.,:
Disable the slider while running if you want simplicity or allow dynamic change as you have it.
Display stats such as how many fetch requests have been sent.
Security considerations:
This script makes automated requests to external servers. Ensure this aligns with your acceptable use policy for those services.
Example tweak for better URL and rate control:
js
function enforceTorCircuitSwitch() {
const hash = Math.random().toString(36).slice(2, 15);
// Use a valid static resource with a unique query param:
const url = `https://cdn.jsdelivr.net/npm/lodash-es@4.17.15/lodash.min.js?cacheBuster=${hash}`;
fetch(url, { mode: 'no-cors', cache: 'no-store' }).catch(() => {});
}
function startStreams() {
const count = Number(streamCountInput.value);
for(let i = 0; i < count; i++) {
timers[i] = setInterval(enforceTorCircuitSwitch, 1000); // slower to reduce load
}
}
If you'd like, I can help you create a more sophisticated version with concurrency control, statistics display, error handling, or even Tor integration hints. Let me know!