I am developing a messenger app using WebSockets, I want to run the server script in a Linux VM instance and access it using the VMs public IP from the client script running from my and a friends system ( such that I and the friend can chat ) but how do I go about running a script on VM, am I supposed to make an app and deploy it to app engine and then somehow get that deployed app in the VM? I am really confused, do correct me if anything above if wrong, I am new to cloud
1 Answer
Running a virtual machine on Google Compute Engine is the most straightforward solution. This will allow you to set up a public IP, SSH to the VM, upload your script, and execute it in the terminal. Try the Linux quickstart here to get started.
App Engine could work in this situation but is less suited. App Engine is a Platform-as-a-Service offering that scales compute resources up and down based on the number of concurrent HTTP requests that reach it. Those compute resources are:
- ephemeral, meaning they won't have a consistent public IP to connect to.
- intended to transactionally respond to HTTP requests, meaning they are not suited to running scripts the way a persistent VM would be.