2

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?

It's Guardian Time
  • 363
  • 1
  • 3
  • 6

1 Answers1

2

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.

DazWilkin
  • 32,823
  • 5
  • 47
  • 88