Direct connection bittorrent transfer C or Ruby libtorrent - c

Is it possible to craft a torrent file in such a way that it will bypass a tracker via assigning an IP address of the server hosting the file instead?
I am interested in bittorrents file transfer protocol via libtorrent and they way it downloads files as pieces in such a way that you get an exact corruption free duplicate on the other side, but I would like to bypass the tracker since the files will always be located at one location.
If this is not possible is there any other protocols/libraries I can look into that can be implemented in C, C++ or Ruby?

If you want to do this using the bittorrent protocol, you can do it by creating a .torrent file with a webseed in it. WebSeed - HTTP/FTP Seeding (GetRight style) - BEP19
Then you use a ordinary HTTP or FTP server to host the file(s).
(Use the IP direct in the URL if you want.)
The downloading can be done with any bittorrent client.
It is not possible to put the address to a peer (bittorrent client) in the .torrent file. See: Is it possible to include peers in trackerless torrent file?

but I would like to bypass the tracker since the files will always be located at one location.
If you're implementing your own client using libtorrent for the purpose of 1:1 transfers you probably can inject the remote host's IP and port explicitly.
I don't think it makes all that much sense to try to twiddle with the torrent file if you are building your own client anyway.

Related

Sending images to server?

I have to write a C++ applicaton that has to read images from a local directory on client computer (linux, ubuntu) and send them to a server (linux, ubuntu).
There will be almost 1000 of such clients.
Assuming that the rest of my program is written in C++ I need some hint on what library+technologies to use to achieve this goal?
That would depend on a number of variables.
First, determine what type of format does the server accept? Is it SOAP or not? If yes, you can stream data to the server. Otherwise, you need to read the entire file first and then, send it.
Second, here is a very good article on how to create a web request in C++. Have a look at it: How do you make a HTTP request with C++?

Do I need to check data integrity after sending file over ftp?

I need to transfer some files from remote computer (on local network) and I plan to do it via FTP.
Apparently, FTP is based on TCP protocol and if I remember well my lessons the difference between TCP and UDP is that TCP checks that network packets are correctly send and received.
After asking myself if I need to add checksum verification, my conclusion was that I don't need to. Am I correct ?
I'm aware of the differences between binary transfer and text transfer and plan to do only binary transfers (working only on Windows).
Do I really need to checksum big files transfered by binary FTP ?
Be it clear, I need data integrity to verify that some bits where not altered during the exchange. Man in the middle is not (much) an issue because the operation will be done in a private network.
Yes, you do.
A man in the middle can alter any TCP packets on the way from the ftp server to your site or he can even act as a malicious ftp site and suppress the original traffic completely.
Therefore you need to verify somehow that that file you received is really the file you wanted to receive. Checksums are suitable for this task.

Is it possible to include peers in trackerless torrent file?

Can I generate torrent file that already has peers inside without using trackers, open trackers, dht and peer exchange?
If yes, how can I do that?
The reason I want to do that, is that I want to get peers by DHT and pass that peers to another torrent client that do not supports DHT or peer exchange, and cannot get peers without trackers.
I found this, but I don't understand what is nodes, and if it's what I am searching for.
http://www.bittorrent.org/beps/bep_0005.html#torrent-file-extensions
And please do not advice me to use uTorrent trackerless torrent functionality where it utorrent becomes a tracker. I am not mistaken in what I need and my question is correct.
Sorry, no, that is not possible.
What client is it? Does it not have support to manualy add peers?
Another metod would be to do it the other way round and manualy add your peer to a PEX capable client and then it would be passed around to other PEX capable clients.
Nodes in torrent files is used as one of many ways to bootstrap the DHT. Explained here.
The only thing comming close to what you want to do is webseeds - BEP19, but it's not applicable in this case.

bittorrent client within silverlight

Is it possible to make bittorrent client within silverlight, which will run in browser?
this would be unusual bittorrent client, he will download data from the server and will seed it. is it possible to do?
Is it possible to do within different, web tech, such as e.g. JavaFX?
Yes, completely possible. You can't receiving incoming connections, but that's no requirement for Bittorrent. The only thing that makes it difficult is that the peers you are connecting to need to serve a socketpolicy file on port 80 or 943, and almost none of them do. Without this policy, the Siverlight BT client will only work in the trusted 'Out of browser'-mode, which make it less usefull.
It's like a chicken-egg problem: as long as their is no large userbase for a Silverlight BT client, 'normal' nodes will not open port 943, and without that port, there never will be a large userbase for such an client.
Adobe solved this smartly by introducing Cirrus, their hosted rendezvous routing service which makes P2P possible from Flash without torrents.
No. You don't have access to the client's file system outside sandbox access.
http://betaforums.silverlight.net/forums/p/9351/29437.aspx

Save Data using Dynamic C

I am using Rabbit single board computer. I would like to save the data I/O which is connected to another Rabbit single board computer through a wireless connection. Is it able to save the data inside the PC in a .txt file for example?
If you can establish a connection to a PC, and the PC is running some server to log data, yes, you could save to a PC. For example, the PC could run a TFTP server or FTP server on the same wireless network, and you could connect to it from the rabbit SBC and save whatever data you need to.
Yes, this is possible.
There are two parts to this scenario. Your embedded app needs to know how to connect to a server application running on the PC or network, and you must, of course, have said server application running on the target machine.
If you're sending entire files, FTP, as bdonlan suggested, is a good way to go. The protocol is well-understood and you can probably find a library to wrap it for you.
If you need to log data real-time, you'll need to have some sort of application which can receive messages or accept a socket connection, and a protocol to get the text across the wire(less). A web server may be a good way to do this, because you can POST chunks of data to the server with a simple HTTP request, and the server app can decide how to organize and store the information. Once you have a web server running, you may find it beneficial to build some pages that provide basic reporting functionality, so you can see the logged data from any web browser.
This could be less restrictive than FTP, but will require some web development expertise on your part.
Any reasonable solution is going to require that you already have a connection to the wireless network with a correctly-configured and functioning IP stack. Without that, you're probably out of luck connecting to any networked resources.

Resources