Send DHT queries to “router.bittorrent.com” response garbled text

前端 未结 2 1410
旧时难觅i
旧时难觅i 2021-01-23 07:28

I read the DHT Protocol in bep_0005 page.

But when I send a ping query or a find_node query, the server response a garbled text (both of router.bittorrent.com:6881

2条回答
  •  孤城傲影
    2021-01-23 08:11

    the server response a garbled text

    No, the response is bencoded and contains raw binary data.
    It CAN NOT be treated as text.

    In BEP5, to make the raw binary node_id in the examples printable, it has cleverly been chosen to consist of only alphanumeric characters.
    See:
    Bittorrent KRPC - Why are node ID's half the size of an info_hash and use every character a-z?

    The ip key is a extension explained in: BEP42 - DHT Security extension

    The received response is fully valid.

    TODO: Working Java code
    

提交回复
热议问题