Answer the question
In order to leave comments, you need to log in
Problem with SOCKETS in Python not over LAN?
Need help. Created a client-server chat It works on the local network, but NO via the Internet. And I looked at the external IP on 2ip.ru after entering the IP in the server part of the program, the error OSError: [WinError 10049] The required address for its context is incorrect. What to do?
IP is static.
Server code:
# -*- coding: utf-8 -*-
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.bind(('ВНЕШНИЙ АЙПИ',9090))
while 1:
message = s.recv(128)
print (message)
Answer the question
In order to leave comments, you need to log in
1. Specify the real external IP in the binding code, run it and check whether the port is open here or not: https://portchecker.co/
2. If the router - then specify (change!) In the binding code the INTERNAL IP of the computer and do port forwarding/mirroring from the external network to the inside.
There is no need to forward the port only when the IP of the computer matches the external IP check on any web checker, for example, on myip.ru. This means that your computer is connected directly to the Internet without additional intermediate networks (usually through a router).
External IP, most likely on the router, and on the router - NAT. You need to configure port forwarding on a computer inside the local network.
It is possible that the provider has an external IP in general, and you need a wire. gives a private address. In this case, you need to buy a white address from the operator for money.
Hello, I'm new to this business.
Trying to open Client/Server Chat as described in https://www.youtube.com/watch?v=MPjgHxK8k68&t=59s
I have Windows 10, I run two attached files via Windows Console (cmd.exe):
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question