From 2bc5fb10a7ae1b3a7ac537aaa1aeed646dc650e2 Mon Sep 17 00:00:00 2001 From: XMRig Date: Tue, 18 Feb 2020 21:42:01 +0700 Subject: [PATCH] Added "-x" and "--proxy" command line options. --- README.md | 1 + src/base/kernel/config/BaseTransform.cpp | 3 +++ src/base/kernel/interfaces/IConfig.h | 1 + src/core/config/Config_platform.h | 7 ++++--- src/core/config/usage.h | 5 +++-- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 99d798f1..2110d280 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ Network: -u, --user=USERNAME username for mining server -p, --pass=PASSWORD password for mining server -O, --userpass=U:P username:password pair for mining server + -x, --proxy=HOST:PORT connect through a SOCKS5 proxy -k, --keepalive send keepalive packet for prevent timeout (needs pool support) --nicehash enable nicehash.com support --rig-id=ID rig identifier for pool-side statistics (needs pool support) diff --git a/src/base/kernel/config/BaseTransform.cpp b/src/base/kernel/config/BaseTransform.cpp index 71b3b3ad..1894f0c6 100644 --- a/src/base/kernel/config/BaseTransform.cpp +++ b/src/base/kernel/config/BaseTransform.cpp @@ -176,6 +176,9 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch case IConfig::SelfSelectKey: /* --self-select */ return add(doc, Pools::kPools, Pool::kSelfSelect, arg); + case IConfig::ProxyKey: /* --proxy */ + return add(doc, Pools::kPools, Pool::kSOCKS5, arg); + case IConfig::LogFileKey: /* --log-file */ return set(doc, BaseConfig::kLogFile, arg); diff --git a/src/base/kernel/interfaces/IConfig.h b/src/base/kernel/interfaces/IConfig.h index 26f71469..470f36ef 100644 --- a/src/base/kernel/interfaces/IConfig.h +++ b/src/base/kernel/interfaces/IConfig.h @@ -66,6 +66,7 @@ public: UserAgentKey = 1008, UserKey = 'u', UserpassKey = 'O', + ProxyKey = 'x', VerboseKey = 1100, TlsKey = 1013, FingerprintKey = 1014, diff --git a/src/core/config/Config_platform.h b/src/core/config/Config_platform.h index 1cf12337..cd5567db 100644 --- a/src/core/config/Config_platform.h +++ b/src/core/config/Config_platform.h @@ -5,8 +5,8 @@ * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , - * Copyright 2018-2019 SChernykh - * Copyright 2016-2019 XMRig , + * Copyright 2018-2020 SChernykh + * Copyright 2016-2020 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,7 +40,7 @@ namespace xmrig { -static const char short_options[] = "a:c:kBp:Px:r:R:s:t:T:o:u:O:v:l:S"; +static const char short_options[] = "a:c:kBp:Px:r:R:s:t:T:o:u:O:v:l:Sx:"; static const option options[] = { @@ -88,6 +88,7 @@ static const option options[] = { { "cpu-memory-pool", 1, nullptr, IConfig::MemoryPoolKey }, { "cpu-no-yield", 0, nullptr, IConfig::YieldKey }, { "verbose", 0, nullptr, IConfig::VerboseKey }, + { "proxy", 1, nullptr, IConfig::ProxyKey }, # ifdef XMRIG_FEATURE_TLS { "tls", 0, nullptr, IConfig::TlsKey }, { "tls-fingerprint", 1, nullptr, IConfig::FingerprintKey }, diff --git a/src/core/config/usage.h b/src/core/config/usage.h index cfda7ff4..bc2cff3d 100644 --- a/src/core/config/usage.h +++ b/src/core/config/usage.h @@ -5,8 +5,8 @@ * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , - * Copyright 2018-2019 SChernykh - * Copyright 2016-2019 XMRig , + * Copyright 2018-2020 SChernykh + * Copyright 2016-2020 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,6 +50,7 @@ static inline const std::string &usage() u += " -u, --user=USERNAME username for mining server\n"; u += " -p, --pass=PASSWORD password for mining server\n"; u += " -O, --userpass=U:P username:password pair for mining server\n"; + u += " -x, --proxy=HOST:PORT connect through a SOCKS5 proxy"; u += " -k, --keepalive send keepalived packet for prevent timeout (needs pool support)\n"; u += " --nicehash enable nicehash.com support\n"; u += " --rig-id=ID rig identifier for pool-side statistics (needs pool support)\n";