rate limit socks 5 connections
This commit is contained in:
parent
f94427ecca
commit
187266426a
1 changed files with 7 additions and 5 deletions
|
@ -151,14 +151,16 @@ void donar_client(struct donar_client_ctx* ctx, struct donar_params* dp) {
|
|||
load_onion_services (ctx, dp->onion_file, dp->links);
|
||||
printf("--- Onion services loaded\n");
|
||||
|
||||
for (int i = 0; i < dp->links; i++) {
|
||||
init_socks5_client(ctx, i);
|
||||
}
|
||||
printf("--- TCP Clients Connected\n");
|
||||
|
||||
init_timer(&ctx->evts);
|
||||
printf("--- Inited Timer\n");
|
||||
|
||||
for (int64_t i = 0; i < dp->links; i++) {
|
||||
int64_t to_wait_sec = 10 + i * 3;
|
||||
fprintf(stdout, "[%s][donar-client] Triggering socks5 in %ld seconds for port %d\n", current_human_datetime (), to_wait_sec, i+7500);
|
||||
set_timeout(&ctx->evts, 1000 * to_wait_sec, (void*) i, reinit_socks5);
|
||||
}
|
||||
printf("--- TCP Clients Connected\n");
|
||||
|
||||
g_ptr_array_foreach (dp->remote_ports, (void(*)(void*, void*))init_udp_remote, &(ctx->evts));
|
||||
printf("--- Remote ports are binded locally\n");
|
||||
|
||||
|
|
Loading…
Reference in a new issue