From 0a485b20907b13cb375cf4dc8de17f56880badaa Mon Sep 17 00:00:00 2001 From: refan Date: Thu, 2 Jul 2026 13:23:31 +0000 Subject: [PATCH 1/5] Update run_options.h --- src/run_options.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/run_options.h b/src/run_options.h index 27b12cfe4..e4e815dcf 100644 --- a/src/run_options.h +++ b/src/run_options.h @@ -45,6 +45,7 @@ typedef struct Run_Options { char nameserver_path[TOXIC_MAX_PATH_LENGTH]; char config_path[TOXIC_MAX_PATH_LENGTH]; char nodes_path[TOXIC_MAX_PATH_LENGTH]; + char nodes_list_url[TOXIC_MAX_PATH_LENGTH]; bool logging; FILE *log_fp; From 6e18f38fca010859d4dce4df61965ced138265bf Mon Sep 17 00:00:00 2001 From: refan Date: Thu, 2 Jul 2026 13:29:26 +0000 Subject: [PATCH 2/5] Update main.c --- src/main.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 5d9ec85fc..350fb3f05 100644 --- a/src/main.c +++ b/src/main.c @@ -861,6 +861,7 @@ static void print_usage(void) fprintf(stderr, " -l, --logging Enable toxcore logging: Requires [log_path | stderr]\n"); fprintf(stderr, " -L, --no-lan Disable local discovery\n"); fprintf(stderr, " -n, --nodes Use specified DHTnodes file\n"); + fprintf(stderr, " -N, --nodes-url Use specified DHTnodes list url\n"); fprintf(stderr, " -o, --noconnect Do not connect to the DHT network\n"); fprintf(stderr, " -p, --SOCKS5-proxy Use SOCKS5 proxy: Requires [IP] [port]\n"); fprintf(stderr, " -P, --HTTP-proxy Use HTTP proxy: Requires [IP] [port]\n"); @@ -994,6 +995,7 @@ static void parse_args(Toxic *toxic, Init_Queue *init_q, int argc, char *argv[]) {"logging", required_argument, 0, 'l'}, {"no-lan", no_argument, 0, 'L'}, {"nodes", required_argument, 0, 'n'}, + {"nodes-url", required_argument, 0, 'N'}, {"help", no_argument, 0, 'h'}, {"noconnect", no_argument, 0, 'o'}, {"namelist", required_argument, 0, 'r'}, @@ -1010,9 +1012,9 @@ static void parse_args(Toxic *toxic, Init_Queue *init_q, int argc, char *argv[]) }; #ifdef TOX_EXPERIMENTAL - const char *opts_str = "4bdehLotuxvc:f:l:n:r:s:p:P:T:"; + const char *opts_str = "4bdehLotuxvc:f:l:n:N:r:s:p:P:T:"; #else - const char *opts_str = "4bdehLotuxvc:f:l:n:r:p:P:T:"; + const char *opts_str = "4bdehLotuxvc:f:l:n:N:r:p:P:T:"; #endif // TOX_EXPERIMENTAL int opt = 0; @@ -1076,6 +1078,16 @@ static void parse_args(Toxic *toxic, Init_Queue *init_q, int argc, char *argv[]) break; } + case 'N': { + if (optarg == NULL ) { + init_queue_add(init_q, "Invaild argument for option : %d", opt); + break; + } + + snprintf(run_opts->nodes_list_url, sizeof(run_opts->nodes_list_url), "%s", optarg); + break; + } + case 'o': { run_opts->no_connect = true; init_queue_add(init_q, "DHT disabled"); From dd1127f5e9da0a56d34b04d89778b024bcdc13d0 Mon Sep 17 00:00:00 2001 From: refan Date: Thu, 2 Jul 2026 13:32:53 +0000 Subject: [PATCH 3/5] Update bootstrap.c --- src/bootstrap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bootstrap.c b/src/bootstrap.c index 576d56d72..30c57d1b7 100644 --- a/src/bootstrap.c +++ b/src/bootstrap.c @@ -29,7 +29,7 @@ #include "windows.h" /* URL that we get the JSON encoded nodes list from. */ -#define NODES_LIST_URL "https://nodes.tox.chat/json" +#define DEFAULT_NODES_LIST_URL "https://nodes.tox.chat/json" #define DEFAULT_NODES_FILENAME "DHTnodes.json" @@ -206,7 +206,11 @@ static int curl_fetch_nodes_JSON(const Run_Options *run_opts, struct Recv_Curl_D goto on_exit; } - ret = curl_easy_setopt(c_handle, CURLOPT_URL, NODES_LIST_URL); + if (!string_is_empty(run_opts->nodes_path)) { + ret = curl_easy_setopt(c_handle, CURLOPT_URL, run_opts->nodes_list_url); + } else { + ret = curl_easy_setopt(c_handle, CURLOPT_URL, DEFAULT_NODES_LIST_URL); + } if (ret != CURLE_OK) { fprintf(stderr, "Failed to set url (libcurl error %d)", ret); From 379f99999a55b917e0f7eadc0112c18053e807e2 Mon Sep 17 00:00:00 2001 From: refan Date: Thu, 2 Jul 2026 13:34:23 +0000 Subject: [PATCH 4/5] Update toxic.1.asc --- doc/toxic.1.asc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/toxic.1.asc b/doc/toxic.1.asc index 1287e8b9c..abc24361e 100644 --- a/doc/toxic.1.asc +++ b/doc/toxic.1.asc @@ -46,6 +46,9 @@ OPTIONS -n, --nodes nodes-file:: Use specified 'nodes-file' for DHT bootstrap nodes instead of '~/.config/tox/DHTnodes.json' +-N, --nodes-url nodes-list-url:: + Use specified 'nodes-list-url' for DHT bootstrap nodes status info instead of 'https://nodes.tox.chat/json' + -o, --noconnect:: Do not connect to the DHT network From b0c285a092d729f74302a1633510299bf6f1e6b3 Mon Sep 17 00:00:00 2001 From: refan Date: Thu, 2 Jul 2026 13:35:49 +0000 Subject: [PATCH 5/5] Update toxic.1 --- doc/toxic.1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/toxic.1 b/doc/toxic.1 index ffab2c70a..1dcdf0379 100644 --- a/doc/toxic.1 +++ b/doc/toxic.1 @@ -91,6 +91,14 @@ for DHT bootstrap nodes instead of \fI~/\&.config/tox/DHTnodes\&.json\fR .RE .PP +\-N, \-\-nodes\-url nodes\-list\-url +.RS +Use specified +\fInodes-list-url\fR +for DHT bootstrap nodes status info instead of +\fIhttps://nodes\&.tox\&.chat/json\fR +.RE +.PP \-o, \-\-noconnect .RS 4 Do not connect to the DHT network