Closed fschmuck closed 2 years ago
Hum, I am afraid I missed something there.
Yes, the low level is not properly implemented. It works when both sides (client and server) are generated code by the plug-in. But it won't work with another (standard) implementation.
I'll work quickly on this one. But it will take some days.
Étienne
Thank you very much.
Would it be a viable approach to implement the SubProtocolCapable interface on the generated WebsocketHandler and set allowed subprotocols via the plugin configuration?
It seems a good idea, as it would allow a retro-compatibility with the existing code. There is currently no way to add a new protocol per configuration in the plug-in. So this would need a patch.
That being said, AFAIK, the current and only protocol that is really managed is the graphql-transport-ws protocol, as specified by graphql-ws. Are we speaking about the same thing ?
Étienne
Yes, right.
Update:
I'm working on this subject, and it's quite a mess.
Apollo-server-express implements this Sec-WebSocket-Protocol: graphql-ws
header.
The name of the protocol, in the http GET Web Socket exchange is graphql-ws
, as you pointed out. From the doc, what's behind is actually subscription-transport-ws
(which is deprecated and no longer maintained), and this is the library that is included.
But graphql-ws
is also the name of the library (not included in apollo-server-express apparently), that defines and implement the graphql-transport-ws
protocol. This one seems to be the future of subscription. But not currently implemented in Apollo (again, from the docs)
:(
I implemented the graphql-transport-ws
, and I will make it available in the next release.
But I think it won't solve this issue.
I'll continue digging into this, and see how to be compliant with this Sec-WebSocket-Protocol: graphql-ws
header, that Apollo accepts.
Etienne
No news on this issue, since the delivery of the graphql-transport-ws
.
Closing this issue
Does the current implementation support the Sec-WebSocket-Protocol: graphql-ws header? Because when I want to establish a connection with this header from my frontend-client the connection will be closed instantly.