Skip to content

TorConfig: HTTP calls (RGS, scoring, LNURL-auth) bypass SOCKS proxy #834

@FreeOnlineUser

Description

@FreeOnlineUser

Problem

When TorConfig is set, only peer connections to .onion addresses are routed through the SOCKS proxy. All HTTP calls made by ldk-node (RGS gossip sync, pathfinding scoring, and LNURL-auth) go direct over clearnet.

This means even a node connecting exclusively to .onion peers still leaks its IP to rapidsync.lightningdevkit.org on every gossip sync cycle.

Proposal

Route HTTP calls through the configured SOCKS5 proxy when TorConfig is set. Three call sites in ldk-node use bitreq for HTTP:

  • gossip.rs: RGS snapshot fetch
  • scoring.rs: external pathfinding scores
  • lnurl_auth.rs: LNURL-auth challenge/response

bitreq's proxy feature currently supports HTTP CONNECT but not SOCKS5. SOCKS5 support (~180 lines, RFC 1928) would need to be added to bitreq, either upstream or via fork.

This could be unconditional (always proxy HTTP when TorConfig is set) or gated behind an opt-in flag. Happy to hear what the maintainers prefer.

Context

I'm building a mobile Lightning node (Android) with embedded Tor (Arti). I have a working implementation of this: SOCKS5 in a bitreq fork + proxy plumbing in ldk-node. Tested on a live node with an open channel. Happy to submit a PR if this direction makes sense.

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