Dear Defolder,
the sample code for the extension shows “params” as an empty table, but I need to send a wsprotocol. How do I use the “params” table in the new “extension-websocket” extension?
Note: The official documentation (Defold extension-websocket) DOES show a listing in the PARAMETERS for the “params” table but, and I am assuming this is a mistake, the documentation reads the parameters as:
Note how the reference to params claims that “The following parameters can be set” but then follows with no parameters. Most likely a doc problem because the docs were put up pretty recently if I’m not mistaken
I mean that I need to send a wss connection with a connectionProtocol, referred to in nodeJS as “req.requestedProtocols[0]” (connectionProtocol is a string that is sent along with the ws connect request, usually to request a certain format, device, or get the server to acknowledge something or categorize the connection differently than a standard connection)
In the old defold-websocket extension, the syntax was to accept the second string parameter in the ws:connect as the protocol (example: self.ws:connect("ws://domain.ext", "protocol"))
Correct, it isn’t yet supported, but as @britzl pointed out, I left some (commented out) helper in there, in order to help the person implementing the feature.