How can I get a tunnelling link from an app deployed on GCP Shell?

69 Views Asked by At

I've deployed a python app that uses SocketIO using the GCP Shell/Text editor as a backend server. I want to connect a flutter frontend. To do this, I need a tunnelling link, and I was wondering if anyone could help me find it, or, if there was another way to deploy python code so that I could get a tunnelling link?

1

There are 1 best solutions below

0
On

You can use SSH and port-forwarding to forward Cloud Shell instance ports to your host's ports.

The easiest way to do this is using gcloud cloud-shell ssh with the (gcloud) --ssh-flag flag and the SSH (!) -L flag:

gcloud cloud-shell ssh --ssh-flag="-L {LOCAL}:localhost:{REMOTE}"

Where {LOCAL} is the local host's port and {REMOTE} is the port on the Cloud Shell instance.

Cloud Shell is provided as an easy way to access a Compute Engine instance and pre-installed tools (including gcloud). I'd discourage using it as a host for your server for anything other than testing.