How can I run a WebSocket server on top of GAE? - google-app-engine

How can I run a WebSocket server on top of Google App Engine? Is it possible? Will it be possible?

Is it possible?
No.
You can't right now because GAE doesn't allow generic inbound socket connections. Each request is also limited to 30 seconds but this could easily be worked around with automatic reconnection and session tracking.
Will it be possible?
Probably.
Google has been one of the biggest (main) promoters of the WebSockets standard. I would be surprised if they don't push support for it into GAE at some point in the future. Note that the WebSockets draft standard is still in flux so Google might be hesitant to add support before the standard is more solid.
Here is the bug for WebSockets support on GAE: http://code.google.com/p/googleappengine/issues/detail?id=2535
Note that a google employee indicates it's not on the roadmap but that they know it would be useful. That's about as positive an answer as you get from google about features that have not been announced. I recommend adding your voice to that bug in favor of WebSocket support. It can't hurt.
Also, depending on your application, you may consider the Channel API which will likely have GAE support soon:
http://googleappengine.blogspot.com/2010/05/app-engine-at-google-io-2010.html
http://bitshaq.com/2010/09/01/sneak-peak-gae-channel-api/
EDIT (2015): the Channels API is available now (it has been for a while).

All of these answers are out of date.
The Channel API has been deprecated. Google strongly recommends you use Firebase.
It is also worth noting, that Google has now released the flexible environment.
With the flexible environment, you could easily allow socket connections, or use Python 3.

It's officially supported now.
See https://cloud.google.com/appengine/docs/python/channel/
EDIT: the Channel API is supported, not WebSockets. The Channel API is built on WebSockets, but it doesn't give you direct access to the WebSocket. I suppose it's good enough for typical Web apps.

As of January 9, 2019 it is officially in Beta now - but only for App Engine flexible. For example, see the Python documentation. According to the issue tracker, it will work with any language, though.

You can't.
GAE limits HTTP requests to 30 seconds, WebSockets expect to have connection open for a long time.
Will it be possible? Only Google knows this.

A couple people have gotten websockets working with GAE with the help of another server... checkout http://code.google.com/p/typhoonae/wiki/WebSockets

There's also this: https://cloud.google.com/appengine/docs/go/sockets/
It's experimental and very low level though.

Google App Engine has recently launched support for Websockets on App Engine Flexible Environment. You can take a look at their blog post.
https://cloud.google.com/blog/products/application-development/introducing-websockets-support-for-app-engine-flexible-environment

June 2019
Websocket support for GAE is now supported under SLA for Flex.
Hi everyone, I'm happy to announce that Websockets support
for Flex is now Generally Available! We've made no changes since Beta
but Websockets traffic is now subject to our SLA.
We've also published documentation for this feature for all App Engine Flex languages.
See https://issuetracker.google.com/issues/35886348#comment285

Hope helps, but seems to be supported now. 2021
[https://cloud.google.com/appengine/docs/flexible/java/using-websockets-and-session-affinity][1]

Related

How can I upgrade the version of TLS on an application running in app engine to > 1.2

I am running an Angular app inside app engine. Recently this application was PEN tested and one of the issues that came up was around TLS1.0 and TLS 1.1 in use.
The recommendation from these results are to disable all TLS protocols before TLS1.2. Only use cipher suites considered cryptographically strong.
The application presently doesnt have a custom domain and is purely hosted on .appspot.com
How do I achieve this? Would I need to use a custom domain for this? I've tried read around but feel a little out of my comfort zone with this.
Thanks
To achieve that you should contact directly GCP's Support Team.
Bear in mind that this is not supported within the free trial support package.
If you don't have a Support Plan, upgrading to the Development plan with only 1 user would be enough to open a support case and request TLS changes for the needed domains.

Choosing between Google Cloud Flexible or Standard Environment

I'm starting to build a web/mobile app that is going to be offered as SaaS.
I have seen many cloud options for hosting (Heroku, AWS) but finally decided to go with Google Cloud App Engine.
My back-end will be Java based, and I'm confused about going with the Standard or Flexible Env.
I have read several docs online but still undecided.
Considerations to tackle:
I am not very experienced with Docker and this is my first Saas App.
My app should run perfectly with the offering of the Standard Env.
Migrating from the Standard to the Flex environment seems to bring
some headache.
Would you please help me decide on the way to?
We try to cover the key differences in this doc:
https://cloud.google.com/appengine/docs/the-appengine-environments
To cover your considerations:
You don't need to understand Docker to use flex or standard
If your app can run in Standard - that's great!
Migrating from Standard to Flex is a fair bit of work. We try to cover it here
Read over those docs, and let me know if you have any other questions!

Are Cloud Endpoints with Go Google App Engine Standard possible?

I have implemented a simple API in Go on Google App Engine Standard using just:
func init() {
http.HandleFunc("/api/v1/resource",submitResource)
}
Nothing special. However I want to port this code to using Cloud Endpoints instead in order to get the better monitoring and diagnostics.
Is it even possible with STANDARD instances or must I move to FLEXIBLE?
I can't find any documentation on this. Nor answers to this seemingly simple question. At the moment I half wish I had chosen Python because its support seems more mature. I chose Go because it seems more appropriate for API-like code because my minimal research suggested Go offered better performance.
If it is possible, are there any pointers to how please?
Only Python and Java are supported on GAE Standard via the Endpoints Frameworks. However, Go is supported on GAE Flexible.
Here is the Go GAE Flexible sample:
https://github.com/GoogleCloudPlatform/golang-samples/tree/master/endpoints/getting-started
After much research and trial and error, the simple answer is "No." - as of Dec 2016.
The longer answer is it's possible if you want to put far too much effort into making up to date libraries of your own. There is basically no support, even in alpha, for the current Google Cloud Endpoints using Go with Google App Engine Standard.
It's possible to run Go+endpoints on GAE Standard environment, however libraries might be outdated now.
Libraries and sample app can be found on github:
https://github.com/GoogleCloudPlatform/go-endpoints
I have successfully deployed "Greetings" as AppEngine SE app, and it works.

Google Cloud Endpoints stability?

I am using this link to build a simple chat application using GCM, and I found this great feature "Google Cloud Endpoints" which makes things easier. But I am afraid to depend on it as I noticed it is still experimental. Can I trust it or should I use Java Servlets instead?
It is true that the tag 'experimental' is a bit scary. If you are concerned, you could consider holding back a bit until Google IO 2013, which is the middle of May. They often make announcement and introduce new technologies there.
They first announced endpoints at last years' Google IO (in July) and if there any significant changes pending for endoints they would likely announce them at this years'.
If you do start using Endpoints, just for Android, and w/o user authentication, I don't think it would be too hard to revert to using a Servlet instead, if you had to (i.e. due to a change in terms that was off-putting). The user authentication stuff would be harder to replace IMO.
As far as I have used Google Cloud Endpoints they work perfectly. Furthermore many interesting features are already implemented, such as integration with Google Eclipse Plugin and testing through the Google APIs Explorer, even in localhost, using the Development Server.
I understand they're still experimental maybe because they're just a new technology not really thoroughly tested yet and are subject to updates. Anyway I've not found significant bugs so far and you should be able to reuse your endpoints with the sucesive versions that will exist. It doesn't seem to be something that will dissapear in the near future...
This is an older question, but for further references I want to say that my short experience was not so pleasant.
I tried "Mobile Backend App". In the beginning, everything worked fine, but after a few days (without changing anything) I received:
GoogleJsonResponseException 404 Not Found
I sow other posts on stackoverflow and manage to solve it by creating another project. I changed the code and it still worked. But again I had problems I played a bit with the 2 projects, I redeployed and changed the settings (tips found on other posts) and it worked. Now it is no longer working, no matter what I do.
I hope that the problem is specific to this project, but nevertheless it is frustrating.

Can Google App Engine ever support SSL with custom domains (i.e. with Google Apps)? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Does Google App Engine support SSL for apps hosted as mydomain.com?
I know that GAE does not support this yet, but is there any reason it can't be done? If they can add support, I'd assume they're working on that. Have they said anything about this publicly?
There are a few different ways they might choose to handle this, including automatic IP address re-routing and SNI. It has been one of the most requested features for well over a year, and very recently, they officially put it on their Product Roadmap. It was also mentioned in their App Engine for Business announcement.
SSL for custom domains is supported for tests since October 2011.
Update:
Full description of SSL for a Custom Domain.
App Engine has now launched SSL for Custom Domains. You can choose from either SNI or VIP based SSL. Wildcard and multi domain certificates are supported which allow you to use your certificates across multiple applications and domains.
They can - there is no technical reason why not, especially with newer TLS versions (RFC 4366) which support virtual hosted SSL/TLS. Before this point an SSL session required a dedicated IP per certificate.
There is no such support at the moment but it's noted in the roadmap for upcoming releases.
You can run SSL on your custom domain by using a third-party service. Here's a HOWTO I wrote up explaining how to do it using CloudFlare:
http://blorn.com/post/20185054195/ssl-for-your-domain-on-google-app-engine
They found an interesting way around the one-cert-per-IP address. Since they register the certificates, they register each cert with 20+ domains on it. That way they multiplex 20 different domains on a single IP address.
At any rate, we use it at Voost and we're pretty happy with it.

Resources