Search code examples
google-app-enginegoogle-cloud-platformcloudapp-engine-flexible

WebSocket server on managed VM not properly exposed trough GAE URL


A normal webserver in a ManagedVM can listen on 0.0.0.0:8080 and properly serve requests dispatched through the GAE URL: http://xx.appspot.com:80

Instead of a normal webserver, try serving websocket connections and things no longer work. No connection gets handled anymore when connecting on: ws://xx.appspot.com:80

This (http://stackoverflow.com/questions/27827752/websocket-support-in-managed-vm) SO topic suggests exposing port 8080 to the Internet from the GCE network settings and using the IP of the GCE instance directly. That works indeed, but is not helpful as the IP changes on every new deployment.

If this is indeed the way to go, then it's not documented anywhere. The only clue I've seen is that a Google employee also uses IP discovery to connect to the right GCE instance that hosts a websocket server: https://github.com/proppy/cacophon/blob/master/frontend/api/controllers/DiscoveryController.js

I'm hoping for a proper fix that doesn't require me to use introspection for gather IPs of the VM instances hosting websocket servers.


Solution

  • With reference to Google issue tracker, Since this thread was opened more than two years ago, I would like to check with you that if you're still hoping for the fix/FR about WebSocket server on Flex not properly exposed through GAE ULR?

    for more update you can check Google issue tracker