0
edits
Changes
→Метатрекеры
--download-from "192.168.1.2:7764"</nowiki>
===МетатрекерыMetatrackers===
Metatracker is a server which informs nodes about available trackers and start nodes.
Metatracker's URL is given at the source when creating a broadcast and is recorded to the transport file.
Metatrackers allow to add trackers and/or start nodes for the broadcast automatically without the need to restart the broadcast and recreate the transport file.
Example of launching a source with the metatracker:
<nowiki>acestreamengine \
--stream-source-node \
--upload-to "192.168.1.3:8631"</nowiki>
Metatracker accepts requests via HTTP protocol and gives responds in JSON format, therefore the metatracker can be implemented on the basis of any web server.
When broadcast starts, each node sends to the metatracker HTTP GET request with parameter <tt>infohash</tt> (broadcast hash as a hex-string). Example of the request to the metatracker:
<nowiki>http://example.org/metatracker.php?infohash=a94a8fe5ccb19ba61c4c0873d391e987982fbbd3</nowiki>
Respond format:
<nowiki>{
"trackers": ["tracker_url_1", "tracker_url_2", ...],
}</nowiki>
where
*tracker_url_1, tracker_url_2 - URLtrackers' трекеровURL
*node1_address, node2_address - адресаstart стартовыхnodes' узловaddresses вas видеstrings строк в форматеin ip:port format (напримерfor example, 192.168.1.2:8632)
*UPDATE_INTERVAL_IN_SECONDS - интервалupdate обновленияinterval вin секундахseconds (какhow частоoften каждыйeach клиентclient долженhas повторноto обращатьсяreapply наto метатрекерmetatreker)
Respond example:
<nowiki>{
"trackers":["udp:\/\/tracker.example.org:2710\/announce"],
}</nowiki>
Example of a server code on PHP:
<nowiki><?php
$infohash = isset($_GET['infohash']) ? $_GET['infohash'] : '';