Note that there are some explanatory texts on larger screens.

plurals
  1. POSend file to user behind a NAT router
    primarykey
    data
    text
    <p>I need to send a file to a user behind a router. I know I can do this with a tcp connection if he enables port forwarding on his router. I want to avoid this in order to make my application easier to use for my users. So I been trying to do tcp punch holing and that is almost impossible. I managed to do udp puch holing. </p> <p>if you already know what udp punch holing is, then you may skip this part:</p> <p>so what I did in order to establish a connection between two users that happen to be behind a router was. user 1 talks to a server that has a WAN ip address via the udp protocol. user 2 also does the same thing. ok so now the server knows the remote end point of each user. the server now sends user 2 the info of user 1. server notifies user 1 that user 2 has received the info. user 2 then sends packages to the router ip address of user 1. the packages received by that router get forwarded to user 1 because they come from the port specified by the server. so know all the packages that user 2 sends to the router of user 1 will get to user 1 if they are sent through the port that was specified by the server. when the packages arrive to user 1 those packages arrive with user 2 info. user 1 now know how to send data two user 2 as well. </p> <p>So now I am able to send data between two users that happen to be behind distinct routers. The reason why I used the udp protocol was because it is similar to tcp when using c#. I been trying to do this with tcp but I just cannot make it work. this application that I am crating is written in c# and everything works great when users happen to be behind the same router. but know I want to extend the functionality. </p> <p>So now I finally got my first step on connecting two clients behind a different nat. the only problem is that the only way I managed to do this was with the upd protocol. I been reading that upd does not ensure the delivery of data and also that data may be received on a different order. </p> <h2>Maybe I can create an algorithm in order to be able to send data via udp knowing that data will not be lost.</h2> <p>another alternative is to use a different protocol such as ftp, bittorrent... etc. I don't know if it will be possible to do ftp punch holing though. </p> <p>so in short I just want to be able to enable two peers that are behind distinct routers to be able to communicate with the help of a server. I do not want to communicate through ralying (connection goes from client A to server to client B) because sometimes it get's difficult to manage and it is expensive to maintain when a lot of users use it. Maybe I should use a different protocol such as a bittorrent library and I haven't done that because I haven't find a good example on the internet that shows you how to use that library. </p> <hr>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload