21 lines
494 B
JavaScript
21 lines
494 B
JavaScript
|
const tor_axios = require('tor-axios');
|
||
|
const tor = tor_axios.torSetup({
|
||
|
ip: 'localhost',
|
||
|
port: 9050,
|
||
|
controlPort: '9051',
|
||
|
controlPassword: 'KarlMax',
|
||
|
})
|
||
|
|
||
|
async function main() {
|
||
|
let response = await tor.get('http://api.ipify.org');
|
||
|
let ip = response.data;
|
||
|
console.log(await tor.get('http://api.ipify.org'));
|
||
|
|
||
|
await tor.torNewSession(); //change tor ip
|
||
|
|
||
|
response = await tor.get('http://api.ipify.org');
|
||
|
ip = response.data;
|
||
|
console.log(ip);
|
||
|
}
|
||
|
|
||
|
main()
|