Tox/tox.chat

Is it possible to use own self-hosted server to establish reliable connections?

Closed this issue · 6 comments

As I understand, tox works on p2p, or serverless principle.

Is it possible to add trusted server to make connections more reliable? As addition to p2p?

I think maybe you could host your own DHT node (https://tox.chat/faq.html#tox-central-servers) to help with that. This repository is only for tox.chat website. You should ask your question in toxcore repo: https://github.com/TokTok/c-toxcore.

@le93us You are in the wrong place to ask that question but I'm going to answer you still.

Tox doesn't use servers in the real sense of that word. Instead it uses nodes (similar to how BitTorrent works). As stated on the Tox's wiki's page about nodes [1]:

In order to facilitate quick connections to other people using Tox, Tox employs bootstrap nodes that each client may connect to in order to retrieve a list of clients currently connected to the pool.

You can (and are encouraged to) run your own bootstraping node [2]. Not only it will provides you more privacy, but it also helps the Tox network to be even more resiliant to attacks and lower latency on the network [3] (afaik).

That's in theory. Now in pratic if you want to use your own node(s) to connect, not only this/those nodes needs to be running h24 (or during time you use it/them), but you'll also need to compile the client of your choice by editing the nodes it connects to as currently no client (AFAIK, again) allows to customize bootstrap nodes.

Here's the file you would need to edit for the 3 most « populars » Tox clients:

  • uTox src/tox_bootstrap.h - Be sure to NOT run the tools/update-bootstrap.py script otherwise your modifications will be overrided ;
  • qTox res/settings.ini - Same as above, do not run the update script ;
  • Toxic - You need to edit the ~/.config/tox/DHTnodes.json file or pass a -n/--nodes option with the path of your custom Nodes file.

I hope this helps. Be aware that Tox-client will provides such settings in the app UI. But it is not yet usable. :p

What do you mean by "more reliable connections"? Do you have some issues with the reliability of connections? Toxcore tries to connect to your contacts directly, from your IP to your contact's IP, without any middle name. A server in the middle wouldn't make the connection any more reliable, nor would running your own bootstrap node. Bootstrap nodes are used only to join the DHT in order to be able to discover peers and be able to discovered by them, it doesn't deal much with connection reliability.

Thanks for replies,

one my idea was to use tox as corporate messenger bounded to employees only - in this case there must be deployed self hosted solutions to make it works.

As I understand from your responses, it must be bootstraping and DHT nodes.

@SkyzohKey Apologies for bumping old issue, but I don't know where else to ask this question. Do you know if Tox uses server sockets in order to communicate? Being p2p, I'm puzzled as to why port forwarding isn't required and there appears to be no socket listening.

@MangaD toktok IRC channel or toxcore repo would be the appropriate places to ask that.

To answer your question, Tox communicates mostly over UDP, though you can force it to use TCP. Port forwarding is not needed as DHT handles hole punching.