Issue with HTTP request using node through TOR
<p>I am relatively new to both node and TOR. I'm trying to send a request using a node application through TOR. Ive set up a basic app using <a href="https://github.com/mattcg/socks5-http-client" rel="nofollow noreferrer">socks5-HTTP-client</a>. Also, TOR is installed (sudo port install tor) and I ran the server using <code>tor</code>.. </p>

<p>Executing the app, node gives me the following error</p>

<pre><code>Error: SOCKS connection failed. General SOCKS server failure.
    at Socket.&lt;anonymous&gt; (/Users/MyName/node_modules/socks5-client/lib/Socket.js:199:12)
    at Socket.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at Socket.Readable.push (_stream_readable.js:110:10)
    at TCP.onread (net.js:523:20)
</code></pre>

<p>The TOR server reports the following to me:</p>

<pre><code>[warn] Rejecting SOCKS request for anonymous connection to private address [scrubbed].
</code></pre>

<p>The topic I found <a href="https://tor.stackexchange.com/questions/1537/what-does-warning-rejecting-socks-request-for-anonymous-connection-to-private">here</a> does not seem to apply to this case. Also, <a href="https://stackoverflow.com/questions/11530159/doing-http-requests-through-a-socks5-proxy-in-nodejs?rq=1">this</a> earlier article does not answer my question. Neither can I find any difference between the <a href="https://github.com/mattcg/socks5-http-client/blob/master/example/tor.js" rel="nofollow noreferrer">example</a> given by the developer of the socks5 module and my case.</p>

<p>I am unsure whether this is an issue with my configuration in node or my TOR configuration.</p>

<p>Below is the JS code</p>

<pre><code>var shttp = require('socks5-http-client');
var config = 
        { url: 'http://whatismyipaddress.com/', // I'd like to see a different IP on every request, that should be the end result, correct?
      socksHost: '127.0.0.1',
        socksPort: 9050
    }
shttp.get(config, function(res) {
    res.setEncoding('utf8');
    res.on('readable', function() {
        console.log(res.read());
    });
});
</code></pre>

<p>Also, in my <code>torrc.sample</code> configuration file, I made sure the following is set up:</p>

<pre><code>SOCKSPort 127.0.0.1:9050 
</code></pre>

<p>Also, my SOCKSPolicy is set up as follows: </p>

<pre><code>SOCKSPolicy accept 192.168.0.0/16
SOCKSPolicy accept6 FC00::/7
SOCKSPolicy reject *
</code></pre>

<p>At the time of trying, my internal IP address was 192.168.0.11, seems fine to me.</p>

<p>Any help would be appreciated!</p>