Answer the question
In order to leave comments, you need to log in
How to connect two things: socket and external ip (internet)?
There is a server and client part (everything is already written). For example, ip = 123.432.412.123 (external ip + it is dynamic). And the client connects to 123.432.412.123:4124. bind doesn't work. Why? Everything works on localhost. How can a client connect to my computer over the Internet? And how not to "hit" the router? Do not dig into its settings
Answer the question
In order to leave comments, you need to log in
Try to communicate via https://www.zerotier.com/
"ZeroTier One runs over a peer to peer network, which means that allowing devices to communicate directly is central to how it operates (at scale and with acceptable performance). Since most users are behind NAT devices, people often wonder how exactly peer to peer connectivity is established."
A common problem is that the ISP usually gives out a "gray" IP. Not only is it dynamic (i.e., you have to use a DNS binding), it is also NAT, i.e. you will not be able to get into your computer using it.
Solutions:
1. Request a "white" IP from the provider. It will most likely cost money.
2. Create/rent a VPS and port your port to it. On this server, open (using the management console) the necessary ports. Then create an SSH connection with a reverse tunnel inside. The tunnel will listen on a port on the server and allow traffic to the specified port on your computer. The client part of the application will have to knock on the external address of the VPS server, and the server part will listen to the port on the computer.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question