Skip to content

feat: having tor lnurls resolve properly. #104

@dni

Description

@dni

Image

Yes. With Python + httpx, route requests to .onion through Tor’s SOCKS5 proxy.

1) Install dependencies

  pip install "httpx[socks]"

2) Use Tor SOCKS proxy (note socks5h)

socks5h means “proxy does hostname resolution” (needed for .onion).

  import httpx

  TOR_SOCKS = "socks5h://127.0.0.1:9050"   # or 9150 (Tor Browser), or whatever you configured

  url = "http://youronionaddresshere.onion/"

  with httpx.Client(proxy=TOR_SOCKS, timeout=30.0) as client:
      r = client.get(url)
      print(r.status_code)
      print(r.text[:500])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions