summaryrefslogtreecommitdiff
path: root/nodegen
diff options
context:
space:
mode:
authorpranomostro <pranomostro@posteo.net>2017-06-03 19:58:18 +0200
committerpranomostro <pranomostro@posteo.net>2017-06-03 19:58:18 +0200
commita5a18a2b84f29595a85bca039df184a454443093 (patch)
treed9b4f19de3b0f27efbb0437d7c17340971e3e2b6 /nodegen
parentea8e549499a682ec96444a98de3c86fda8a0e7f8 (diff)
Add connecting to tcp relays by default.
I'm currently staying in India, and strangely enough ratox could not connect using tox_bootstrap(). It would just continue attempting to connect until the end of time. Using tox_add_tcp_relay() additionally fixes this isssue. It is also the strategy utox uses: https://github.com/uTox/uTox/blob/49bc764d23a02ab8286ef6f2085e8e592bccde1e/src/tox.c#L137 Also, nodes.h needed to be regenerated for using tcp ports and relays.
Diffstat (limited to 'nodegen')
-rwxr-xr-xnodegen7
1 files changed, 5 insertions, 2 deletions
diff --git a/nodegen b/nodegen
index 8134198..4133e3d 100755
--- a/nodegen
+++ b/nodegen
@@ -3,7 +3,10 @@
echo 'static struct node nodes[] = {'
curl -s https://nodes.tox.chat/json |
-jq --tab '[.nodes[] | select(.last_ping > 0) | {".addr4": .ipv4, ".addr6": .ipv6, ".port": .port, ".idstr": .public_key}]' |
-sed 's/"-"/NULL/; s/"\(\.[0-9a-z]\+\)":/\1 =/; 1d; $d'
+jq --tab '[.nodes[] |
+ select(.last_ping > 0) |
+ select(.tcp_ports | length > 0) |
+ {".addr4": .ipv4, ".addr6": .ipv6, ".udp_port": .port, ".tcp_port": .tcp_ports[0], ".idstr": .public_key}]' |
+sed 's/"-"/NULL/; s/"\(\.[0-9a-z_]\+\)":/\1 =/; 1d; $d'
echo '};'