Http request fails via TOR proxy when fetching an https resource

Describe the problem/error/question

Fetching an https resource via a TOR proxy fails.

What is the error message (if any)?

In fact after a lot of time waiting for the response the execution is green, not red, but the final data is not there.

Please share your workflow

Share the output returned by the last node

imagen

Information on your n8n setup

  • 1.14.2
  • Running n8n via docker

More info:

So here’s the setup and info:

  • In a docker engine I run a network tor and 2 containers: tor and n8n.
  • The tor is the dperson/torproxy with no special fancies:

Run with:

docker run \
    -d \
    --restart always \
    --network tor \
    --name tor \
    -p 15000:9050 \
    -p 15001:8118 \
    dperson/torproxy

The n8n container MAY access the tor proxy, AND MAY do the request, AND it works.

To test the raw container, I entered in the n8n container as root and did this:

host$ docker exec -it -u root n8n sh
n8n# apk update
n8n# apk search curl
n8n# apk add curl

Then I exitted and re-entered without privileges and performed the curl:

host$ docker exec -it n8n sh
n8n$ curl --proxy http://tor:8118 https://checkip.amazonaws.com
[I see exit node's IP]
n8n$ curl --proxy http://tor:8118 https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending
[I see HTML result here]
n8n$ curl --proxy http://tor:8118 https://example.com
[I see HTML result here]

All 3 URLs via https, and via the TOR proxy work perfectly, so there’s no problem at the docker or operating system level. Therefore it must be a problem with the n8n thing and its underlying (unmature?) libraries.

Then inside the n8n interface I test 12 scenarios

{ 3 URL } x { resurce via http or https } x { direct, proxied }

The 3 URLs without proto are:

Then I get:

  • http, direct (no proxy) => all 3 work
  • https, direct (no proxy) => all 3 work
  • http, via TOR proxy => depends on the resource (*)
  • https, via TOR proxy => all 3 fail :point_left::point_left::point_left:

(*)
good => http://checkip.amazonaws.com
good => http://example.com
fail => http://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending

Question:

I need to get some HTTPS resources via TOR.

How can I automate this within n8n?

Hi @xmontero :wave: I had a look into this using the exact same image for Tor, and it looks like this is indeed an issue. When I tested using Insomnia to make the HTTP requests outside of n8n, they all completed just fine and within a few seconds.

I’ve created a ticket for our engineering team to look into this - I’ll be back once I have any updates! Unfortunately for the moment I wouldn’t know of a workaround to this within n8n though :see_no_evil:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.