Apollo-server: Passing PerMessageDeflate configuration options to the WebSocket Server

Created on 7 Jun 2019  路  2Comments  路  Source: apollographql/apollo-server

We have a UseCase for GraphQL Subscriptions where we'd like to activate perMessageDeflate on the underlying WebSocket server. Normally, this can be configured with the PerMessageDeflate ServerOption on the WebSocket Server, but as far as I know there is currently no way to pass additional configuration options to the Server.

Therefore, I'd like to propose to add a perMessageDeflate configuration Option to the SubscriptionServerOptions object in the ApolloServer Config.

I could provide a PR for this.

馃攲 websockets

Most helpful comment

I have the opposite issue on my server, where the WebSocket is closed before the connection is established.
I'm using a microsoft azure app-service for this, and an FAQ article says to disable perMessageDeflate.
If this is related, maybe perMessageDeflate is activated by default?

In any case, providing websocket configuration option to the ApolloServer config could be useful.

All 2 comments

I have the opposite issue on my server, where the WebSocket is closed before the connection is established.
I'm using a microsoft azure app-service for this, and an FAQ article says to disable perMessageDeflate.
If this is related, maybe perMessageDeflate is activated by default?

In any case, providing websocket configuration option to the ApolloServer config could be useful.

I am also experiencing a possible issue with perMessageDeflate being enabled by default. I am using a dot net graphql client, and it is failing to connect.

Can anybody confirm if it is enabled or disabled by default?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hiucimon picture hiucimon  路  3Comments

manuelfink picture manuelfink  路  3Comments

deathg0d picture deathg0d  路  3Comments

veeramarni picture veeramarni  路  3Comments

attdona picture attdona  路  3Comments