Skip to content

Commit

Permalink
Merge xmrig-proxy v6.12.0 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
MoneroOcean committed Apr 20, 2021
2 parents b73e844 + f1cc071 commit 44255f5
Show file tree
Hide file tree
Showing 44 changed files with 1,207 additions and 426 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v6.12.0
- [#2276](https://github.com/xmrig/xmrig/pull/2276) Added support for Uplexa (`cn/upx2` algorithm).

# v6.11.0
- [#2196](https://github.com/xmrig/xmrig/pull/2196) Improved DNS subsystem and added new DNS specific options.
- [#2207](https://github.com/xmrig/xmrig/issues/2207) Fixed regression in HTTP parser and llhttp updated to v5.1.0.

# v6.10.1
- [#441](https://github.com/xmrig/xmrig-proxy/issues/441) Fixed send buffer overflow with custom diff.

Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ add_definitions(/DXMRIG_ALGO_CN_LITE)
add_definitions(/DXMRIG_ALGO_CN_HEAVY)
add_definitions(/DXMRIG_ALGO_CN_PICO)
add_definitions(/DXMRIG_ALGO_CN_GPU)
add_definitions(/DXMRIG_ALGO_CN_FEMTO)
add_definitions(/DXMRIG_ALGO_ARGON2)
add_definitions(/DXMRIG_ALGO_ASTROBWT)

Expand Down
104 changes: 64 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,53 +30,77 @@ Use [config.xmrig.com](https://config.xmrig.com/proxy) to generate, edit or shar

### Options
```
-b, --bind=ADDR bind to specified address, example "0.0.0.0:3333"
-a, --algo=ALGO mining algorithm https://xmrig.com/docs/algorithms
--coin=COIN specify coin instead of algorithm
-m, --mode=MODE proxy mode, nicehash (default) or simple
-o, --url=URL URL of mining server
-O, --userpass=U:P username:password pair for mining server
-u, --user=USERNAME username for mining server
-p, --pass=PASSWORD password for mining server
-r, --retries=N number of times to retry before switch to backup server (default: 1)
-R, --retry-pause=N time to pause between retries (default: 1 second)
--custom-diff=N override pool diff
--reuse-timeout=N timeout in seconds for reuse pool connections in simple mode
--verbose verbose output
--user-agent=AGENT set custom user-agent string for pool
--no-color disable colored output
--no-workers disable per worker statistics
--variant algorithm PoW variant
--donate-level=N donate level, default 2%
-B, --background run the miner in the background
-c, --config=FILE load a JSON-format configuration file
--no-watch disable configuration file watching
-l, --log-file=FILE log all output to a file
-S, --syslog use system log for output messages
-A --access-log-file=N log all workers access to a file
--api-port=N port for the miner API
--api-access-token=T use Bearer access token for API
--api-worker-id=ID custom worker-id for API
--api-no-ipv6 disable IPv6 support for API
--api-no-restricted enable full remote access (only if API token set)
--tls enable SSL/TLS support for pool connection (needs pool support)
--tls-bind=ADDR bind to specified address with enabled TLS
--tls-cert=FILE load TLS certificate chain from a file in the PEM format
--tls-cert-key=FILE load TLS certificate private key from a file in the PEM format
--tls-dhparam=FILE load DH parameters for DHE ciphers from a file in the PEM format
--tls-protocols=N enable specified TLS protocols, example: "TLSv1 TLSv1.1 TLSv1.2 TLSv1.3"
--tls-ciphers=S set list of available ciphers (TLSv1.2 and below)
--tls-ciphersuites=S set list of available TLSv1.3 ciphersuites
-h, --help display this help and exit
-V, --version output version information and exit
Network:
-o, --url=URL URL of mining server
-a, --algo=ALGO mining algorithm https://xmrig.com/docs/algorithms
--coin=COIN specify coin instead of algorithm
-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 keepalived packet for prevent timeout (needs pool support)
--rig-id=ID rig identifier for pool-side statistics (needs pool support)
--tls enable SSL/TLS support (needs pool support)
--tls-fingerprint=HEX pool TLS certificate fingerprint for strict certificate pinning
--dns-ipv6 prefer IPv6 records from DNS responses
--dns-ttl=N N seconds (default: 30) TTL for internal DNS cache
--daemon use daemon RPC instead of pool for solo mining
--daemon-poll-interval=N daemon poll interval in milliseconds (default: 1000)
--self-select=URL self-select block templates from URL
--submit-to-origin also submit solution back to self-select URL
-r, --retries=N number of times to retry before switch to backup server (default: 5)
-R, --retry-pause=N time to pause between retries (default: 5)
--user-agent set custom user-agent string for pool
--donate-level=N donate level, default 0%%
Options:
-b, --bind=ADDR bind to specified address, example "0.0.0.0:3333"
-m, --mode=MODE proxy mode, nicehash (default) or simple
--custom-diff=N override pool diff
--custom-diff-stats calculate stats using custom diff shares instead of pool shares
--reuse-timeout=N timeout in seconds for reuse pool connections in simple mode
--no-workers disable per worker statistics
--access-password=P set password to restrict connections to the proxy
--no-algo-ext disable "algo" protocol extension
API:
--api-worker-id=ID custom worker-id for API
--api-id=ID custom instance ID for API
--http-host=HOST bind host for HTTP API (default: 127.0.0.1)
--http-port=N bind port for HTTP API
--http-access-token=T access token for HTTP API
--http-no-restricted enable full remote access to HTTP API (only if access token set)
TLS:
--tls-bind=ADDR bind to specified address with enabled TLS
--tls-gen=HOSTNAME generate TLS certificate for specific hostname
--tls-cert=FILE load TLS certificate chain from a file in the PEM format
--tls-cert-key=FILE load TLS certificate private key from a file in the PEM format
--tls-dhparam=FILE load DH parameters for DHE ciphers from a file in the PEM format
--tls-protocols=N enable specified TLS protocols, example: "TLSv1 TLSv1.1 TLSv1.2 TLSv1.3"
--tls-ciphers=S set list of available ciphers (TLSv1.2 and below)
--tls-ciphersuites=S set list of available TLSv1.3 ciphersuites
Logging:
-S, --syslog use system log for output messages
-l, --log-file=FILE log all output to a file
-A --access-log-file=FILE log all workers access to a file
--no-color disable colored output
--verbose verbose output
Misc:
-c, --config=FILE load a JSON-format configuration file
-B, --background run the proxy in the background
-V, --version output version information and exit
-h, --help display this help and exit
--dry-run test configuration and exit
```

## Donations

Default donation fee is 2% can be reduced to 1% or disabled via `donate-level` option. Donation fee applies only if you use more than 256 miners.

* XMR: `48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD`
* BTC: `1P7ujsXeX7GxQwHNnJsRMgAdNkFZmNVqJT`

## Contacts
* [email protected]
Expand Down
73 changes: 73 additions & 0 deletions src/3rdparty/llhttp/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,70 @@ void llhttp_init(llhttp_t* parser, llhttp_type_t type,
}


#if defined(__wasm__)

extern int wasm_on_message_begin(llhttp_t * p);
extern int wasm_on_url(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_status(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_header_field(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_header_value(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_headers_complete(llhttp_t * p);
extern int wasm_on_body(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_message_complete(llhttp_t * p);

const llhttp_settings_t wasm_settings = {
wasm_on_message_begin,
wasm_on_url,
wasm_on_status,
wasm_on_header_field,
wasm_on_header_value,
wasm_on_headers_complete,
wasm_on_body,
wasm_on_message_complete,
NULL,
NULL,
};


llhttp_t* llhttp_alloc(llhttp_type_t type) {
llhttp_t* parser = malloc(sizeof(llhttp_t));
llhttp_init(parser, type, &wasm_settings);
return parser;
}

void llhttp_free(llhttp_t* parser) {
free(parser);
}

/* Some getters required to get stuff from the parser */

uint8_t llhttp_get_type(llhttp_t* parser) {
return parser->type;
}

uint8_t llhttp_get_http_major(llhttp_t* parser) {
return parser->http_major;
}

uint8_t llhttp_get_http_minor(llhttp_t* parser) {
return parser->http_minor;
}

uint8_t llhttp_get_method(llhttp_t* parser) {
return parser->method;
}

int llhttp_get_status_code(llhttp_t* parser) {
return parser->status_code;
}

uint8_t llhttp_get_upgrade(llhttp_t* parser) {
return parser->upgrade;
}

#endif // defined(__wasm__)


void llhttp_reset(llhttp_t* parser) {
llhttp_type_t type = parser->type;
const llhttp_settings_t* settings = parser->settings;
Expand Down Expand Up @@ -150,6 +214,7 @@ void llhttp_set_lenient_headers(llhttp_t* parser, int enabled) {
}
}


void llhttp_set_lenient_chunked_length(llhttp_t* parser, int enabled) {
if (enabled) {
parser->lenient_flags |= LENIENT_CHUNKED_LENGTH;
Expand All @@ -159,6 +224,14 @@ void llhttp_set_lenient_chunked_length(llhttp_t* parser, int enabled) {
}


void llhttp_set_lenient_keep_alive(llhttp_t* parser, int enabled) {
if (enabled) {
parser->lenient_flags |= LENIENT_KEEP_ALIVE;
} else {
parser->lenient_flags &= ~LENIENT_KEEP_ALIVE;
}
}

/* Callbacks */


Expand Down
Loading

0 comments on commit 44255f5

Please sign in to comment.