gost icon indicating copy to clipboard operation
gost copied to clipboard

working with tor as reverse proxy

Open TheShadowMax opened this issue 3 months ago • 1 comments

@ginuerzh

I'd like to start by apologizing for the interruption and to express my gratitude for your wonderful software. We use it in numerous projects, and everything works great.

However, I've now encountered an issue where I need to set up proxying to a .onion address. I can't seem to configure it properly or figure out what's wrong. Could you please advise how to implement HTTP proxying through Tor's SOCKS5, including specifying the hostname?

-- I tried creating a configuration like this, but unfortunately it fails to connect to the remote host.

services:
- name: http-to-onion
  addr: :8080
  handler:
    type: tcp
    metadata:
      sniffing: true
  listener:
    type: tcp
  forwarder:
    nodes:
    - name: onion-proxy
      addr: duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion:80
      connector:
        type: socks5
        addr: 127.0.0.1:9050
      http:
        host: duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion

If I use it on the clearnet, there are no issues. But with .onion domain names, it unfortunately doesn't work.

TheShadowMax avatar Sep 21 '25 16:09 TheShadowMax

As an alternative, if it's easier, could you please advise how to convert tor SOCKS5 into an HTTP proxy, so that I could then route traffic through nginx like this?

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host "duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

I found similar tickets in the repository, but unfortunately they haven't received any responses from anyone, and I still haven't found a solution to this issue.

TheShadowMax avatar Sep 21 '25 16:09 TheShadowMax