java -jar azdht.jar
AzDHT is a modified version of Azureus Java BitTorrent Client so that it has no UI and just runs it's DHT and provides interface to access it. This makes it possible for external programs to use Azureus DHT without actually implementing it.
Probably the most easy way to install and run AzDHT is downloading the jar archive. There is no need to install or configure, just run
java -jar azdht.jar
and the DHT will be running. The default UDP port for DHT is 7995 and the interface server listens on localhost:7994. Different ports can be specified on command line; see list of available options for details.
Specify port number for the DHT.
Prints help screen.
Specify port number for server interface.
Turns on DHT's logging.
To make AzDHT use port number 9000 for DHT and 9001 for server interface with messages logged to standard output run:
java -jar azdht.jar -d9000 -s9001 -v
or
java -jar azdht.jar -d9000 --server-port=9001 --verbose
or any other combination of long and short options. Note that each option has to stand alone.
Server communicates with clients over TCP protocol. Each message starts with 4 bytes integer in big endian that denotes length of the following bencoded message.
Each message is bencoded dictionary. Item with key request specifies DHT operation as a string: get, put or remove. Names of the operations are self-descriptive. The key for all operation is stored as a string with key key. get operation requires flag element with integer value. Operation put requires value element with string value and flag element with integer value. There is no required element other than key for remove operation.
Server sends messages only to get request or if the sent request was invalid. In that case the message has response element set to string failed, put element contains description of the error and request field contains sent message. If the message couldn't be decoded then nothing is replied. If an error occurs then the server closes connection.
Response to get message has response element set to get with following additional fields: key contains key for the requested values and values is a list with dictionaries. Each value's dictionary has following elements: flags are value's flags as integer; originatorIP is IP address of value's originator stored as a string; originatorPort is integer with originator's port; finally field value contains string with the value.
AzDHT is distributed under the same license as Azureus is - GPL.
Author of AzDHT is David Brodsky (trekie at sinister dot cz).
Azureus homepage is located at http://azureus.sourceforge.net - visit it, if you want to know more about it.