Closed rgillan closed 10 years ago
This should be already supported by #15. You can now pass headers via options.
Why has this been implemented in a non-standard way? The WebSocket Standard defines the constructor for a WebSocket: [Constructor(DOMString url, optional (DOMString or DOMString[]) protocols)] By assuming that the second argument to the constructor is a JSON object, this breaks standard compliant client code that uses the protocols argument for the constructor.
because we need to be able to send additional options / properties used by Java client.
Michal is correct. Browser implementations (which I am assuming you are referring to as the standard reference) today do not allow setting of multiple headings such as option and subprotocol, and in addition there are underlying settings for message size, fragmentation and the like that need to be passed by the constructor so they are not hard coded in the library/plugin. Most third party libraries are configured in this way. I'm sure it's not too difficult for your JavaScript to create the required JSON object
Please excuse brevity and spelling, sent from my phone.
Cheers Rob
On 12 Oct 2013, at 11:36 am, Michal Kuklis notifications@github.com wrote:
because we need to be able to send additional options / properties used by Java Client.
— Reply to this email directly or view it on GitHub.
Similarly to the option header, allow the subprotocol header to be passed to the constructor.