Using PythonAnywhere as a game server

I am creating a turn based game and I am hoping to implement a client server networking architecture. I just need to send the position of multiple objects and some other easily coded data. I am new to the net, although I have coded some basic stuff in socket and twisted. However, now I need to send data to a computer that is not on my local network and I cannot do port forwarding since I do not have administrator access to the router and I am also not absolutely sure what will do the trick anyway. since I've never done it. So I was thinking about running a USB stick or a bottle or Django etc., the code is from PythonAnywhere. Clients then sent the data to the server code in PythonAnywhere, and when the queue passed, another client simply looked at the information it needed on the server. I guess,that then the server will act as a databank with simple getter and setter methods. My question is, how can this be implemented? Can my Socket code of my client program talk to my Flask code on PythonAnywhere?

+3


source to share


2 answers


Yes, client code can talk to your project in PythonAnywhere, since you will be assigned a unique project like http://yourblogname.pythonanywhere.com/ . Your server will listen on port 80 on this url.



+1


source


It depends on what kind of connection your clients need to make on the server. PythonAnywhere supports WSGI, which means "normal" HTTP requests / interactions - GET, POST, etc. This works well for "traditional" web pages or web applications.



If your client side needs dynamic, two-way connections using protocols other than HTTP, using raw sockets, or even websites, PythonAnyhwere does not currently support this.

+1


source







All Articles