Is it possible to include peers in trackerless torrent file? - tracker

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.

Related

WinDivert ignore tor traffic

I'm looked at basil00's TorWall(https://github.com/basil00/TorWall) and cannot understand, how it is possible to ignore traffic that goes from tor?
I'm writing my own torwall and my goal is to add support of different types of proxies(socks5, http[s]). I stuck with problem that inbound traffic from tor.exe is going through the filter. I definitely missed something because torwall is working well.
Tallow ignores Tor traffic based on the port number, e.g. 9001. See the traffic.divert file from the Tallow repository (https://github.com/basil00/TorWall). This is a crude solution, and ideally it should be possible to instruct WinDivert to ignore traffic based on application, however such a feature does not currently exist as of 2018.

Direct connection bittorrent transfer C or Ruby libtorrent

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.

Hosting multiple clients with freemodbus

I am working on a project involving a microcontroller communicating to a PC via Modbus over TCP. My platform is an STM32F4 chip, programming in C with no RTOS. I looked around and found LwIP and Freemodbus and have had pretty good success getting them both to work. Unfortunately, I'm now running into some issues which I'm not sure how to handle.
I've noticed that if I establish connection, then lose connection (by unplugging the Ethernet cable) I will not be able to reconnect (once I've plugged back in, of course). Freemodbus only allows one client and still has the first client registered. Any new clients trying to connect are ignored. It won't drop the first client until after a specific timeout period which, as far as I can tell, is a TCP/IP standard.
My thoughts are...
I need a Modbus module that will handle multiple clients. The new client request after communication loss will be accepted and the first client will eventually be dropped due to the timeout.
How do I modify Freemodbus to handle this? Are there examples out there? I've looked into doing it myself and it appears to be a decently sized project.
Are there any good Modbus packages out there that handle multiple clients, are not too expensive, and easy to use? I've seen several threads about various options, but I'm not sure any of them meet exactly what I need. I've had a hard time finding any on my own. Most don't support TCP and the ones that do only support one client. Is it generally a bad idea to support multiple clients?
Is something wrong with how I connect to the microcontroller from my PC?
Why is the PC changing ports every time it tries to reconnect? If it kept the same port it used before, this wouldn't be a problem
Should I drop the client from Freemodbus as soon as I stop communicating?
This seems to go against standards but might work.
I'm leaning towards 1. Especially since I'm going to need to support multiple connections eventually anyways. Any help would be appreciated.
Thanks.
If you have a limit on the number of modbus clients then dropping old connections when a new one arrives is actually suggested in the modbus implementation guide (https://www.modbus.org/docs/Modbus_Messaging_Implementation_Guide_V1_0b.pdf)
Nevertheless a mechanism must be implemented in case of exceeding the number of
authorized connection. In such a case we recommend to close the oldest unused
connection.
It has its own problems but everything is a compromise.
Regarding supporting multiple clients...if you think about modbus/rs server - it could only ever have one master at a time. Then replace the serial cable with TCP and you see why it's not uncommon to only support one client (and of course it's easier to program). It is annoying though.
Depending on what you are doing you wont need the whole modbus protocol and implementing the parts you do need is pretty easy. Of course if you have to support absolutely everything its a different prospect. I haven't used freemodbus, or any other library appropriate to your setup, so I can't help with suggestions there.
Regarding the PC using different TCP source port each time - that is how TCP is supposed to work and no fault on your side. If it did reuse the same source port then it wouldn't help you because e.g. sequence numbers would be wrong.
Regarding dropping clients. You are allowed to drop clients though its better not to. Some clients will send a modbus command, notice the connection has failed, reconnect, but not reissue the command. That may be their problem but still nicer to not see it that often where possible. Of course things like battery life might make the calculation different.

Reliable way to send file over internet

First of all: I'm not absolutely certain that this is the right place to ask, but I think the question fits here better then on superuser or serverfault, since it is a question from a programmer's perspective: I figured more programmers might have had the same question (although I couldn't find this specific question!).
I would like to have a feature in my program which allows users to send files to a 'friend'. You can find friends via an username: this all goes via a server which can provide the IP-adress of a friend.
I wanted to use a tcp connection to send the file. This becomes difficult, however, when one (or both) of the parties is behind a NAT. What is the best way to solve this? I heard that it's possible to send stuff via a server, but I'd rather send everything directly, to prevent server overhead.
I heard about a technique called hole punching, but also that it's pretty complex to implement and not 100% reliable. I could use UDP and implement some scheme to improve the reliability, but this seems a bit complex to me. I know skype, bittorrent and a whole lot of other programs do similiar things (but I don't know about the specifics, which protocol they use, if they use hole punching etc.).
I looked into FTP a bit, until I realised that this is just a protocol using TCP, so I should use TCP hole punching in order to let this work... Anyway, I hope someone can give me some advice on this :)
If you don't want to make data pass through a server, I'm not aware of other methods other than TCP Hole Punching or simple Port forwarding of a previously choosen port.

Web based NX client?

But I can't seem to find much about how the NX protocol actually works. I have heard it does something with sending X11 commands. But does this mean that the listening clients need to have an x server to run the actual commands and display them?
Basically, I am trying to figure out if it is possible to write an NX client for a web browser, because it sounds interesting to me. Thoughts?
Yes. NX is essentially compressed X-Window protocol.
It's not a spec, but here is a general introduction to how it works: http://www.nomachine.com/documents/NX-XProtocolCompression.php
The client doesn't need to be an X-server, but it will probably need to be able to handle at least some subset of the X protocol.
If you are going to create an web based NX client, make sure you look at noVNC which is a web based VNC/RFB client. Better yet, fork noVNC and add NX support. That way you don't have to waste time on input, events positioning, networking, etc.
Disclaimer: I am the creator of noVNC. Implementing other remote desktop protocols (NX, RDP, Spice) is on my long term todo list (part of the reason for the name). If you're serious, contact me via github and I can give you some direction/thoughts and put you in touch with somebody else who has also expressed interest.

Resources