HuanTing Chen
May 10, 2017 · 2 min read

Recently I implement a websocket server to demo some iOS feature. That server is originally run perfectly on my local side. After some testing, I decide to move the websocket server to google cloud platform to get public ip for demo purpose.

This is my first time using App engine and it really take me a lot of time.

Here are some simple steps for deploy a web socket to GAE.

First, register google cloud platform, now it provide 300 free trail for testing its’ cloud services.

After registry, Clicking App Engine and run the official quick start tutorial step by step.

OK. now we have ability to deploy node.js projects to App Engine.

Then, clone a websocket sample from:

https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/master/appengine/websockets

This is an example from google. It shows how to implement websocket on app engine.

So, we clone the project in gcloud console and deploy and everything will be fine?

NO. we need some modification.

First, modify app.yaml:

#vm: true

env: flex

And Please pay attention to the end of this file:

This part is very important.

And then, enable the port 65080 for your firewall via the command listed in README

After this, just deploy to App Engine and everything will really be fine this time.

After deploy, we will get an URL like:

https://{project name}.appspot.com

Replace https to http since websocket on App Engine is not support secure mode now.

Then, launch the new url started with http:// and try the websocket now!

Note: App Engine preview mode is not work for websocket in my test.

Google Cloud Platform - Community

A collection of technical articles published or curated by Google Cloud Platform Developer Advocates. The views expressed are those of the authors and don't necessarily reflect those of Google.

HuanTing Chen

Written by

iOS Developer

Google Cloud Platform - Community

A collection of technical articles published or curated by Google Cloud Platform Developer Advocates. The views expressed are those of the authors and don't necessarily reflect those of Google.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade