dperson / torproxy

GNU Affero General Public License v3.0
521 stars 146 forks source link

Node.js Error: request timed out #38

Closed loretoparisi closed 4 years ago

loretoparisi commented 4 years ago

When In Node.js using built-in http library and GET with headers

{
    headers: {
        Host: 'api.ipify.org'
    },
    host: '127.0.0.1',
    path: 'https://api.ipify.org/?format=json',
    timeout: 30000,
    method: 'GET',
    port: 8118
}

I get a Error: request timed out, while if using global-tunnel configured as

var globalTunnel = require('global-tunnel-ng');

    globalTunnel.initialize({
        host: 'localhost',
        port: 8118
    });

it works ok.

dperson commented 4 years ago

I've only ever done really light node.js development, and don't feel qualified to support it sorry.

dperson commented 4 years ago

If you're seeing strange behavior from curl, etc. then I will try to figure out what is going wrong. As it stands now, it seems you already have a work around for the issue.

loretoparisi commented 4 years ago

@dperson thank you, cURL works ok. Typically just using Host header as host, port and path in the http module options was enough to pass through the privoxy.