If we search for BT sources file would be treated as a torrent that contain this urn.
To get it info_hash we do litle extension.
It use:
Extension ProtocolHandshake:
{
'm':
{
'rz_urn_to_btih':id
}
}
Если клиент соединился по urn_hash то сервер сразу после рукопожатия должен вернуть результат или ошибку.
If client connect by urn_hash then server after handshake must return result or error.
(bencoded dictionary)
{
'urn': (ansver only)
{
[urn name|имя urn]:[binary hash or value of urn| бинарный хеш или другое значение urn]
},
'btih': (ansver only)
{
[RAW BTIH],
[RAW BTIH],
...
},
'peers': (optional for ansver)
{
[compact peer list for first BTIH]
[compact peer list for second BTIH]
...
}
'request': (request and optional for ansver)
{
[urn name|имя urn]:[binary hash or value of urn| бинарный хеш или другое значение urn]
}
'error': (on error)
{
'id':error_id,
'msg':msg_to_user
}
}
Если пир соединился по urn_hash он должен сбросить соединение после окончания получения/передачи информации. Соединится уже как стандартный пир используя один из перечисленных хешей.
If client connect by urn_hash then it must drop connection after end recive/send information. Then it reconect as normal peer by one of btih in btih list.
urn_hash:
sha1 hash of urn dictionary.
sha1 хеш от urn словаря.
peer use urn_hash to serch and announce in DHT or other places.
peer использует urn_hash для поиска и объявления источников в DHT и других местах.
btih:
btih list of info dictionary that contain this urn.
btih список от info поля которые содержат в себе этот urn.
urn names = analog in info dictionary| имена urn = аналог в info словаре:
urn:tree:tiger: = tiger (preferred | предпочитаемый)
urn:sha1: = sha1
urn:ed2k: = ed2k
urn:md5: = md5sum
urn:btih: