Search code examples
dockergoogle-app-enginegoogle-compute-engineserver-sent-events

Server-sent events blocked when using GAE flexible environment to run docker images


When I try to access server-sent events endpoint locally it works fine and spits out data every two seconds, when I ssh into the appengine vm it also works fine (using curl) but when I try and access the server-side events endpoint from outside appengine I just get timeouts. Is server-side events blocked in GAE? I see that websocket could be troublesome, but server-side events are over http.


Solution

  • No, server-sent events are not blocked in Google App Engine. But since GAE have buffering enabled by default they will never reach you since the request never completes. Disable buffering with this header in your SSE response:

    X-Accel-Buffering: no
    

    Read more here: How Requests are Handled