How to make a socket connection using Hamachi in Python?

Asked

Viewed 217 times

0

I’m trying to connect with socket on another network with Hamachi. When creating the server, I am using the local IP and when connecting I am using the Hamachi IP.

See my code below:

# Código do Servidor

address = ("<IP Local>", 51474)

server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(address)
server.listen(1)

newSocket, clientInfo = server.accept()

# Código do Cliente

address = ("IP do Hamachi", 51474)

client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(address)

print("Conectado com sucesso.")

The problem is that while trying to run the above code, I get the following error:

socket.connect(address)

Connectionrefusederror: [Winerror 10061] No connection could be made because the destination machine actively refused them

Can someone please help me ?

  • And how did you set up Logmein Hamachi? Did you connect everything correctly? You can go into more detail.

  • Yes Hamachi is configured correctly and even works in other places, as in games for example. I also disabled the Firewall as it can sometimes prevent access by Hamachi.

  • And Telnet was able to access?

  • I don’t know what that is.

  • Run a test trying to hear the address 0.0.0.0 in the server code.

  • I tested it with the address 0.0.0.0 and now it presented a different error: Timeouterror: [Winerror 10060] A connection attempt failed because the connected component did not respond correctly after a period of time or the established connection failed because the connected host did not respond

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.