Sockets in Python for a local network?

The essence is this: create a simple server on PC and client on the phone. Server socket bound to the ip, who learned it from a command prompt (ipconfig). When the phone connects to the ip fine (phone and computer on the same LAN), but when I bind the server socket to the external ip (got it from the site myip.ru) swears at him, the interpreter - "OSError: [WinError 10049] the Requested address to its context is wrong." Want to join the phone on the mobile Internet with the computer, but it turns out only over the local network. What to do?
June 10th 19 at 14:33
3 answers
June 10th 19 at 14:35
> bind server socket to the external ip (got it from the site myip.ru)
you can't bind the socket to an ip address that does not belong to your car.
Because this website shows the ip with which you joined the server, or am I wrong? - nikita.Stracke commented on June 10th 19 at 14:38
Yes. but anyway you can't bind the socket to an ip address that does not belong to your car. - shanna commented on June 10th 19 at 14:41
June 10th 19 at 14:37
Give the server a dedicated IP address. Is purchased from the provider, or the server moved to VPS/VDS.
June 10th 19 at 14:39
Think to traverse the port on the router
although... to guess without the code useless.

Find more questions by tags Computer networksPythonIPSockets