D
D
Daniel2018-02-17 06:39:43
Java
Daniel, 2018-02-17 06:39:43

How to connect 2 computers on different networks using sockets.?

Whether who can prompt probably to connect 2 machines in different networks through external IP. Or only through the server on the hosting is possible. For example, I wrote a remote access program with a full set of operations with files, with uploading and downloading files from a remote machine, but it works only inside the local network. And I would like, for example, that being in China I could connect to a remote machine.
I only came up with a solution to connect through a proxy, but then all the data will go through someone's Hosting, and I'm scared to become something, what is the solution. This question is not designed for this program.
We need a principle of implementation, not a program.
All solutions that I found use the scheme. Client->Server->Client. Or like this Client->Server (receives a socket and binds it with another client.) As a result, a Client<->Client2 connection is obtained.
Is it possible to make a connection immediately Client<->Client2

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
res2001, 2018-02-17
@res2001

It went a lot.
NAT will help you.
Only you are afraid of proxies. Aren't you afraid to open a listening port on the Internet? Be afraid! As soon as you go out into the world, they will immediately start breaking you - connections from left addresses, password guessing, etc. will begin. etc. Therefore, without serious software preparation, it is better not to put it on the Internet.
Organize VPN and expose your program inside VPN.

W
w_b_x, 2018-02-17
@w_b_x

There are other solutions to control miners)
ps Why don't programs like teamweaver suit you?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question