nx_http_tracker.nx
buildroot/runtime/nx_http_tracker.nx
about
nx_http_tracker.nx -- SOVEREIGN HTTP/TCP BitTorrent tracker announce (X-TORRENT-LIVE-002 R1).
WHY: this network blocks UDP to the usual tracker ports (:1337/:6969); HTTP trackers ride TCP
:80/:443 (which works -- the browser proves it), so they bypass the UDP block AND give the team a
second, independent peer-discovery channel. Pure-organ: composes nx_http_client (GET over TCP) +
nx_bencode (decode the response) + nx_dns_a (resolve the tracker host). NO curl, NO libtorrent.
The team decides which trackers to use + how to merge peers -- nothing external decides.
announce GET: <path>?info_hash=%XX*20&peer_id=%XX*20&port=6881&uploaded=0&downloaded=0&compact=1
&left=<n>&event=started -> bencoded {interval, peers:<compact 6B/peer>} (or failure)
license_tier: ORIGINAL layer: peer-discovery (feeds the worker's peer set, like cl_announce/UDP)
module: nishi-core.torrent.http_tracker
depends: nishi-core.http_client, nishi-core.bencode, nishi-core.dns_a
dependencies 4 imports · 1 importers
imports: nx_http_client.nxnx_bencode.nxnx_dns_a.nxnx_tracker_url.nx
imported by: nx_torrent_get.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 17 | const K_MAGIC_2048: i64 = 2048 |
| 18 | const K_MAGIC_131072: i64 = 131072 |
| 19 | const K_MAGIC_6881: i64 = 6881 |
| 20 | const K_MAGIC_16909060: i64 = 16909060 |
functions
| 22 | func ht_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 23 | func ht_puts(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i } |
| 24 | func ht_putn(dst: *u8, off: i64, v: i64) -> i64 |
| 32 | func ht_p2(s: *u8) -> i64 { sys_write(1, s, ht_strlen(s)); return 0 } |
| 33 | func ht_pn2(v: i64) -> i64 { let b: *u8 = sys_mmap(28); let e: i64 = ht_putn(b, 0, v); sys_write(1, b, e); return 0 } |
| 34 | func ht_report(label: *u8, ok: i64) -> i64 { if ok == 1 { ht_p2(" [PASS] " as *u8) } else { ht_p2(" [FAIL] " as *u8) } ht_p2(label); ht_p2("\n" as *u8); return 0 } |
| 37 | func ht_urlenc20(raw: *u8, out: *u8) -> i64 |
| 51 | func ht_find_body(buf: *u8, n: i64) -> i64 called by 1: ht_announce |
| 62 | func ht_parse_peers(buf: *u8, boff: i64, n: i64, ips: *i64, ports: *i64, max: i64) -> i64 |
| 83 | func ht_announce(host: *u8, ip4: *u8, port: i64, path: *u8, info_hash: *u8, peer_id: *u8, left: i64, ips: *i64, ports: *i64, max: i64) -> i64 |
| 100 | func ht_announce_url(url: *u8, info_hash: *u8, peer_id: *u8, left: i64, ips: *i64, ports: *i64, max: i64) -> i64 |
| 111 | func main() -> i64 |