upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/main_gui.cpp
diff options
context:
space:
mode:
authorNsable-sh <nsable-sh@noreply.git.bitflash.network>2026-08-11 15:38:31 -0300
committerNsable-sh <nsable-sh@noreply.git.bitflash.network>2026-08-11 15:38:31 -0300
commitff3829b28fd2ddc85a9a3bb4424cd5b4719854ab (patch)
tree2351d19d9695b3a7c32498b23d8d23dde3e28309 /src/main_gui.cpp
parenta83fae37099cb102beb5a4c174a4abe6ef3f24a4 (diff)
net: add optional SOCKS5 outbound proxy
Diffstat (limited to 'src/main_gui.cpp')
-rw-r--r--src/main_gui.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index b036ac9..90a6050 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -1,6 +1,7 @@
1// Bitflash entry point -- starts node threads then runs GUI (or headless). 1// Bitflash entry point -- starts node threads then runs GUI (or headless).
2 2
3#include "headers_core.h" 3#include "headers_core.h"
4#include "proxy.h"
4#include "selftest.h" 5#include "selftest.h"
5#include "walletcmd.h" 6#include "walletcmd.h"
6#include <thread> // hardware_concurrency, to sanity-check /genproclimit 7#include <thread> // hardware_concurrency, to sanity-check /genproclimit
@@ -110,7 +111,8 @@ static void PrintUsage()
110 printf(" /debug\n"); 111 printf(" /debug\n");
111 printf(" /gen\n"); 112 printf(" /gen\n");
112 printf(" /nogui or /daemon\n"); 113 printf(" /nogui or /daemon\n");
113 printf(" /selftest=wallet-keypool, wallet-hd, wallet-format, wallet-crypto, or wallet-encrypt\n"); 114 printf(" /selftest=wallet-keypool, wallet-hd, wallet-format, wallet-crypto, wallet-encrypt,\n");
115 printf(" net-message, consensus-limits, pool-stratum, parse-money, or socks5-proxy\n");
114 printf("\n"); 116 printf("\n");
115 printf("Mining mode:\n"); 117 printf("Mining mode:\n");
116 printf(" /operator\n"); 118 printf(" /operator\n");
@@ -135,6 +137,7 @@ static void PrintUsage()
135 printf("\n"); 137 printf("\n");
136 printf("Network:\n"); 138 printf("Network:\n");
137 printf(" /port=N (P2P listen port, default 8433)\n"); 139 printf(" /port=N (P2P listen port, default 8433)\n");
140 printf(" /socks=HOST:PORT (SOCKS5 proxy for outbound Nostr and .btf relay dials)\n");
138 printf(" /btfseed=ADDRESS:ENCHEX (extra bootstrap peer, repeatable)\n"); 141 printf(" /btfseed=ADDRESS:ENCHEX (extra bootstrap peer, repeatable)\n");
139 printf("\n"); 142 printf("\n");
140 printf("Wallet:\n"); 143 printf("Wallet:\n");
@@ -282,6 +285,17 @@ static void ParseStartupArguments(int argc, char* argv[])
282 if (!announceRelay.empty()) 285 if (!announceRelay.empty())
283 strBtfAnnounceRelay = announceRelay; 286 strBtfAnnounceRelay = announceRelay;
284 287
288 string socksProxy = argval2(argc, argv, "/socks", "-socks");
289 if (!socksProxy.empty())
290 {
291 string err;
292 if (!BtfSetSocks5Proxy(socksProxy, err))
293 fprintf(stderr, "Ignoring /socks=%s: %s\n", socksProxy.c_str(), err.c_str());
294 else
295 fprintf(stderr, "SOCKS5 proxy enabled for outbound discovery/relay dials: %s\n",
296 BtfSocks5ProxyName().c_str());
297 }
298
285 // /btfseed=ADDRESS:ENCHEX -- extra bootstrap peers, repeatable. Useful for 299 // /btfseed=ADDRESS:ENCHEX -- extra bootstrap peers, repeatable. Useful for
286 // testing the seed path and for private networks that ship no compiled list. 300 // testing the seed path and for private networks that ship no compiled list.
287 for (int i = 1; i < argc; i++) 301 for (int i = 1; i < argc; i++)