Commit 76d3875
committed
bitreq: add SOCKS5 proxy support
Add SOCKS5 proxy support (RFC 1928) alongside existing HTTP CONNECT.
Uses domain-based addressing (ATYP 0x03) so DNS resolution happens at
the proxy, enabling .onion routing through Tor.
New public API: Proxy::new_socks5(addr) creates a SOCKS5 proxy config.
Both sync and async handshake paths implemented.
Motivation: ldk-node needs to route HTTP calls (RGS, scoring) through
Tor's SOCKS proxy. See lightningdevkit/ldk-node#834.
Tests: 5 parsing tests + 5 mock handshake tests covering success, .onion
domains, server rejection, port encoding, and domain length validation.1 parent 774a655 commit 76d3875
3 files changed
Lines changed: 415 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
14 | 33 | | |
15 | 34 | | |
16 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
339 | 345 | | |
340 | | - | |
| 346 | + | |
341 | 347 | | |
342 | 348 | | |
343 | 349 | | |
| |||
709 | 715 | | |
710 | 716 | | |
711 | 717 | | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
712 | 724 | | |
713 | | - | |
| 725 | + | |
714 | 726 | | |
715 | 727 | | |
716 | 728 | | |
| |||
0 commit comments