I am new to Tor. I have recently managed to execute a query from node.js while running a tor server instance on my PC.
I have used the following piece of code:
var Agent = require('socks5-https-client/lib/Agent');var request = require("request");var q = "https://www.example.com/";request({ url: q, agentClass: Agent, agentOptions: { socksHost: 'localhost', socksPort: 9050 // Defaults to 1080. }}, function(err, res) { console.log(err || res.body);});
I would like to connect to Tor without running a Tor server on my PC. I believe this is possible with a Tor bridge. I have retrieved an IP address from https://bridges.torproject.org/bridges:
2.91.117.71:443 3C2AAD50197ACE1A43C822BBE282E0534603A31F
I am not really sure how to use this information. I have tried to set:
agentOptions: { socksHost: '2.91.117.71', socksPort: 443 }
but I get a timeout:
{ [Error: connect ETIMEDOUT] code: 'ETIMEDOUT', errno: 'ETIMEDOUT', syscall: 'connect' }
My questions are:
- Is it possible to connect to a public Tor server with https from node.js?
- If yes how?