You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting the WithKeeplive WithKeepAlive(time.time) an asynchronous routine is enabled during pings using the underlying websocket handler from https://github.com/coder/websocket. This underlying handler uses the web socket protocol https://datatracker.ietf.org/doc/html/rfc6455#section-11.8 which is not similar to the sub-protocols graphql-ws / subscriptions-transport-ws Which is supported by this library.
Concretely I experienced that a Graphql Server (implemented with https://github.com/99designs/gqlgen did not understand the pings because of the protocol-confussion, thus leading a connection being dropped and reinitialized.
I do not know whether this is how most servers are implemented, but the protocol is set upon the 101 switch protocol request by the client and then the server choses an appropiate messageExchanger based on the protocol
The text was updated successfully, but these errors were encountered:
Yes, the WithKeepAlive config is used by the WebSocket client. IIRC this follows the implementation of the WebSocket client library. However, it's disabled by default. It should be fine if you don't configure it.
The keep-alive ping-pong events of subscription specs are handled from the server side so the client mostly doesn't need to do anything. It just waits for the ping from the server and reply back.
When setting the WithKeeplive
WithKeepAlive(time.time)
an asynchronous routine is enabled during pings using the underlying websocket handler from https://github.com/coder/websocket. This underlying handler uses the web socket protocol https://datatracker.ietf.org/doc/html/rfc6455#section-11.8 which is not similar to the sub-protocolsgraphql-ws
/subscriptions-transport-ws
Which is supported by this library.Concretely I experienced that a Graphql Server (implemented with https://github.com/99designs/gqlgen did not understand the pings because of the protocol-confussion, thus leading a connection being dropped and reinitialized.
I do not know whether this is how most servers are implemented, but the protocol is set upon the 101 switch protocol request by the client and then the server choses an appropiate messageExchanger based on the protocol
The text was updated successfully, but these errors were encountered: