while implementing the Couchbase Sync Gateway changes feed using a websocket, we noticed that the sync gateway closes the connection after 5 minutes of inactivity. The sync gateway isn’t responding to WebSocket Ping frames (sent by our client) with a Pong, as it should (and is specified in RFC 6455), but with a normal TCP ACK message. Even when sending periodical Ping frames, the connection is closed after 5 minutes. We have found no official way to fix this problem, but we found a workaround which is working, but not elegant.
Even though the documentation says the heartbeat parameter only applies to feed=longpoll or feed=continuous, it is also possible to set it for feed=websocket connections. This leads to sync gateway sending periodical empty messages which keep the connections open, but each message will trigger the client’s “on message” callback and thus has to be handled (e.g. dropped).
Did we miss something, is this expected behaviour or is this a bug and will potentially be fixed in the future?
Thanks for your time and best regards