Orestis Zekai
Orestis Zekai

Reputation: 922

Send variable between PCs over the internet using python

I have two computers with internet connection. They both have public IPs and they are NATed. What I want is to send a variable from PC A to PC B and close the connection.

I have thought of two approaches for this:

1) Using sockets. PC B will have listen to a connection from PC A. Then, when the variable will be sent, the connection will be closed. The problem is that, the sockets will not communicate, because I have to forward the traffic from my public IP to PC B.

2) An out of the box idea, is to have the variable broadcasted online somewhere. I mean making a public IP hold the variable in HTML and then the PC would GET the IP from and get the variable. The problem is, how do I make that variable accessible over the internet?

Any ideas would be much appreciated.

Upvotes: 1

Views: 466

Answers (1)

Orestis Zekai
Orestis Zekai

Reputation: 922

Figured a solution out. I make a dummy server using flask and I hosted it at pythonanywhere.com for free. The variables are posted to the server from PC A and then, PC B uses the GET method to get them locally.

Upvotes: 2

Related Questions