Skip to content

Is dynamic reconfiguration of the WebSocket connection payload supported? #824

@Nickersoft

Description

@Nickersoft

I've been updating my Apollo client recently to more accurately reflect the example Singleton that exists in the latest Apollo iOS documentation. I realized that with this new approach you can rely on the HTTPNetworkTransportPreflightDelegate to attach a dynamic auth header to outgoing HTTP requests, which is super helpful seeing I was previously just rebuilding the client on every user login/logout. I was curious if there is any way to achieve something similar with the WebSocket transport... I noticed it only accepts a hard-coded map of connection header values in its constructor that can't be changed.

I'd be happy to help with implementing a solution if one doesn't currently exist... I'm just not exactly sure of the ideal approach seeing the transport would basically have to forcibly reconnect whenever its connection payload changes. It's a much-needed feature of my app, so I'd love to start a discussion about this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apollo-websocketsquestionIssues that have a question which should be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions