sgqlc
sgqlc copied to clipboard
Support for authentication in WebSocket connections
Hi, I'm using this against an endpoint that enforces authorisation in all requests. This is straightforward in the plain HTTP connections but WebSocket works differently - see here for example: https://www.apollographql.com/docs/graphql-subscriptions/authentication/
It would be really helpful if the WebSocketEndpoint
constructor allowed a dictionary to be passed that could be used in the connection_init
message.
I have forked the project and implemented this (with a test) so if you think it would be useful I can create a pull request for you.
Cheers, Ray
sure, send a patch. I didn't write the websocket myself, I thought it was all handled in the ws_options
.
I initially thought it would be that way too. Pull request is now added.
Thanks.