GoogleCloudPlatform / GoogleCloudPlatform/esp-v2

Websocket connections closes after sending first message to server

Open
#704 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
307
Forks
185
Avg merge
14h 45m
Merged PRs (30d)
6

Description

Also logged in GCP support portal as case id: 29925315

We are having a strange issue with web sockets and esp-v2. Basically, new websocket connections closes after sending first message to server with status `wasClean` false.

image

**Response from websocket connection looks fine:**
image

image
image

**Our setup:**
Browser --> Cloud endpoints (with espv2) --> Cloud run --> Socket.io through NestJs on NodeJs

**If we remove Cloud endpoints and go directly to cloud run, everything works fine.**
Browser --> Cloud run --> Nodejs

**My top suspicions:**
1) There is a timeout being hit for streams.E.g. `max_stream_duration` or similar. I am using defaults for all timeout values; maybe there is another value I can increase?
https://cloud.google.com/endpoints/docs/openapi/specify-esp-v2-startup-options#timeout

This issue seems similar if this is the case:
https://github.com/projectcontour/contour/issues/3692

2) Maybe we have misunderstood what is required in the openapi specification. Currently, we have a /get endpoint for the web sockets. If we remove this, no requests come through, but maybe there is a magic way to configure this.

image

**Is this a bug in esp-v2 or is there maybe some flag we are missing to get it to work?**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.