You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to create a simple torrent unittest ; I'm going to use the wrong terminology for a second and use client + server which is wrong but doing it anyway. With http I would start an http server that serve a file (find a free port etc...), download it with an http client and validate it.
Now things gets interesting with bittorrent :) / I tried reading a couple of articles (like this one https://blog.jse.li/posts/torrent/) to see all steps.
I have put together in a github repo utility code to fetch a torrent (by url) and then downloading it, and a test case that use that function, but first does 'something' to simulate the tracker + eveything done on the other end of the download ...
If someone can give me steps toward the right path it would be awesome.
I'm a bit lost between 'annoucing' the torrent.
I'm using utility code to generate the torrent, by populating the meta-info fields.
I think I must run a tracker, to simulate the current 'servers' I need to emulate in my unittests, I saw full blown projects (chihaya) that do that, but maybe I could start with something simpler ?
I can clarify things too, I understand this is a big ask.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I would like to create a simple torrent unittest ; I'm going to use the wrong terminology for a second and use client + server which is wrong but doing it anyway. With http I would start an http server that serve a file (find a free port etc...), download it with an http client and validate it.
Now things gets interesting with bittorrent :) / I tried reading a couple of articles (like this one https://blog.jse.li/posts/torrent/) to see all steps.
I have put together in a github repo utility code to fetch a torrent (by url) and then downloading it, and a test case that use that function, but first does 'something' to simulate the tracker + eveything done on the other end of the download ...
https://github.com/bsergean/torrent_download
The test file is a bit large but I tried to comment it -> https://github.com/bsergean/torrent_download/blob/master/torrent_download_test.go
If someone can give me steps toward the right path it would be awesome.
I can clarify things too, I understand this is a big ask.
THANKS !
Beta Was this translation helpful? Give feedback.
All reactions