0

Currently I am looking into GraphQL Server from Apollo, to replace our current Java implementation. As we also might want to use subscriptions, I try to get some simple server-client proof of concept up and running. I got the subscription part working using the GitHunt example.

As I don't really need or want a UI. For now, I want a simple client to just receive the notifications from the subscription interface. As fas as I could see, this is Websocket. Knowing that, I created a Python script that opens a websocket to the specified host and port (ws://localhost:8090). This results in a bad handshake error.

What way can I go forward? Did someone already create a client, other than the apollo-client? And if so; how do you create the websocket?

1 Answers1

0

I might try using a headless browser like, slimmer js, It supports websockets. https://github.com/laurentj/slimerjs.

I'm wondering if there is something the python interface just isn't handling that slimer js would be. I'm no websocket expert, so just my 2 cents :)

Justin
  • 2,940
  • 3
  • 25
  • 43
  • The 'annoying' part here, is that I can just use the existing [Apollostack Subscription Transport WS](https://github.com/apollostack/subscriptions-transport-ws) package to make it work in i.e. a headless browser. That still doesn't allow me to use it in any other way. However - I will have a look in SlimerJS and see if it can quickly prove my proof of concept. Thanks! – Mikki Weesenaar Jan 13 '17 at 06:55
  • I did some further analysis using wireshark and it seems that the Subscriptions GraphQL request triggers one or two WebSockets which are handshaked using generated server-client keys. After some hours trying to get it working, I gave up :) Thanks for asking! – Mikki Weesenaar Jan 19 '17 at 21:13