Hi, I am using these codes:
#!/usr/bin/python3
import socket
clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = socket.gethostname()
host_ip = socket.gethostbyname(host)
port = 444
clientsocket.connect((host_ip, port))
message = clientsocket.recv(1024)
clientsocket.close()
print(message.decode('ascii'))
for tcpclient.py following the tutorial; https://www.freecodecamp.org/learn/information-security/python-for-penetration-testing/creating-a-tcp-client
However, when I ran it, it said “clientsocket.connect((host_ip, port))
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
ConnectionRefusedError: [Errno 61] Connection refused”
I am very confused. If someone could give some guidance please!! Thank you!