diff options
| author | Nsable-sh <nsable-sh@noreply.git.bitflash.network> | 2026-08-11 15:38:31 -0300 |
|---|---|---|
| committer | Nsable-sh <nsable-sh@noreply.git.bitflash.network> | 2026-08-11 15:38:31 -0300 |
| commit | ff3829b28fd2ddc85a9a3bb4424cd5b4719854ab (patch) | |
| tree | 2351d19d9695b3a7c32498b23d8d23dde3e28309 /src/proxy.h | |
| parent | a83fae37099cb102beb5a4c174a4abe6ef3f24a4 (diff) | |
net: add optional SOCKS5 outbound proxy
Diffstat (limited to 'src/proxy.h')
| -rw-r--r-- | src/proxy.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/proxy.h b/src/proxy.h new file mode 100644 index 0000000..b5e69c8 --- /dev/null +++ b/src/proxy.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | // Copyright (c) 2026 Bitflash developers | ||
| 2 | // Distributed under the MIT/X11 software license. | ||
| 3 | // | ||
| 4 | // Optional SOCKS5 outbound proxy support. This is transport plumbing only: | ||
| 5 | // no consensus, wallet, mining, or .btf identity data depends on it. | ||
| 6 | |||
| 7 | #ifndef BITFLASH_PROXY_H | ||
| 8 | #define BITFLASH_PROXY_H | ||
| 9 | |||
| 10 | #ifdef _WIN32 | ||
| 11 | #ifndef WIN32_LEAN_AND_MEAN | ||
| 12 | #define WIN32_LEAN_AND_MEAN 1 | ||
| 13 | #endif | ||
| 14 | #include <winsock2.h> | ||
| 15 | #else | ||
| 16 | #include "compat.h" | ||
| 17 | #endif | ||
| 18 | |||
| 19 | #include <string> | ||
| 20 | |||
| 21 | bool BtfParseSocks5Proxy(const std::string& spec, std::string& hostOut, | ||
| 22 | unsigned short& portOut, std::string& errOut); | ||
| 23 | bool BtfSetSocks5Proxy(const std::string& spec, std::string& errOut); | ||
| 24 | void BtfClearSocks5Proxy(); | ||
| 25 | bool BtfSocks5ProxyEnabled(); | ||
| 26 | std::string BtfSocks5ProxyName(); | ||
| 27 | |||
| 28 | SOCKET BtfConnectSocket(const std::string& destHost, unsigned short destPort, | ||
| 29 | int nSockSite, int nTimeoutSecs); | ||
| 30 | |||
| 31 | #endif | ||