Thursday, 17 December 2020

Python server get socket messages without same network

I want to send socket message from my phone to python server, but it works only when I connected to the same network (WiFi). It is possible to get the messages with python if they sent with another network?

I have been looking for an answer for a long time I have not found. No question answers that

My python server that get messages only at the same network with the client:

import socket

server = socket.socket()
server.bind(("10.0.0.2", 12345))

server.listen()

(client, (ipNum, portNum)) = server.accept()
print("Client connected")


while True:
    message = input(">>>")

    client.send(message.encode())

    print(client.recv(21).decode())


from Python server get socket messages without same network

No comments:

Post a Comment