Transfer p2p file over the Internet

I know that there are several similar questions, for example this . I need to configure a connection between two computers and be able to send a large file. Let me explain the problems that I encountered while reading such messages:

1) many of them talked about connecting tcp. I was able to send data, but most of the time I could not send large amounts of data.

2) most of the examples created on local networks. I was able to send data over two different networks over the Internet with tcp examples, but I had to open the ports on the router and redirect them to the computer I wanted to contact.

3) Libraries like monotorrent or bitharp where it’s hard to find, and I have not found good examples. I can not get them to work.

therefore, in short, I just need to send files from one computer to another computer via the Internet, and I don’t want to open ports on the router and not do any port forwarding. people do not need to open ports on their routers when using limewire, for example, and they download files from another computer. It would be nice if someone can provide me with a brief example of how to configure the server and how to send the file to the server with the client code.

-1
source share
2 answers

The problem of opening and forwarding the ports you mention is very real and there is no easy work. Applications such as uTorrent use UPnP port mapping and / or NAT-PMP to automatically talk to your router and make it perform appropriate port mappings on the fly. Not all routers implement these protocols (and in many cases, users can prohibit their use for security reasons), so questions arise on the network about how to forward ports for limewire, uTorrent, etc.

Besides what I read about it, I would recommend that you ask your questions a little more in detail, for example:

I was able to send data, but most of the time I could not send large amounts of data.

It is too vague for us to guess what the problem is. What file size did you send, what connection did you receive errors or were they too slow, etc.?

+2
source

Binfer does exactly what you are trying to do, except that it is closed source and commercial. I do not think it is so simple to do something like this, so you probably will not find examples for this. Once upon a time, I tried JXTA, which promised a lot, but delivered too little.

0
source

Source: https://habr.com/ru/post/1200067/


All Articles