Skip to content

Keep-alive function follows WS protocol (not graphql-ws) #155

@gravgaard

Description

@gravgaard

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions