New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supporting secure websockets #68
Comments
Hi, Think the best way would be to support a new static Default method on GraphQLSubscriptionWebSocketClient which support passing the ClientWebSocket as a parameter. I think this is what corresponds closest to the GraphQLHttpClient default method which support passing in a HttpClient. Thanks for your suggestion :) |
I'll take a look at that route, and see if I can put together something acceptable. Will fire in a Pull Request if I get summat sorted. |
Just having a look at this - I've forked the master, but when I open the solution it has loads of 'type or namespace name does not exist' errors. I don't want to mess about incorrectly with project settings etc - is there something more simple that I'm missing? |
Try installing Visual Studio 2019 with dotnet core. If it does not solve the problem try running the command "dotnet build" and send the errors to me. Thanks for your help with improving the client! :) |
I'm using 2019 (with preview SDK enabled). |
I guess you generate Version.props as a scripted pre-build step? |
Ah okay. Yes thats correct - please see the steps which is required here: I Will update the readme |
You could create a new static Default method which could call a new constructor which takes the websocket as a input parameter. I think that would be a good way to do it. |
Ah, an additional GraphQLSubscriptionWebSocketClient constructor, coupled with an additional static IGraphQLSubscriptionWebSocketClient Default() ? |
Yep that would solve the problem assigning to the readonly variable |
This should now be fixed by #72 |
An essential requirement of my system is to use certificate-based TLS security between client and server.
I've been able to achieve this on queries by adding the certificates to a HttpClientHandler, using that to instantiate a HttpClient, then using the overridden GraphQLHttpClient.Default().
However I can't see a similar route for GraphQLSubscriptionWebSocketClient.Default(). One idea is to expose the ClientWebSocket, or at least the Options, from the GraphQLSubscriptionWebSocketClient class. To allow for an equivalent to
Obviously that itself is the wrong way to do it lol. I just wanted to illustrate the aim, and I've also used this code to check that the basic principle is correct - which it seems to be since it does a wss connection to my server.
I'd be interested to hear your thoughts. Note that I am no expert C# programmer, so there may be a better way to achieve it than simply exposing the ClientWebSocket.
The text was updated successfully, but these errors were encountered: