Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add protocols fallback for Firefox (#20)
On the latest Firefox and Edge versions, with the current version of sockette.js, the usage of opts.protocols without any check causes the browser to send "undefined" in the Sec-WebSocket-Protocol header. Protocol being undefined, the server is likely to send a 426: No Sec-WebSocket-Protocols requested supported (except if you specify on your server side that 'undefined' is a possible protocol value). Passing [] to the WebSocket constructor instead of undefined nullify the need for protocol check on the server side, as browsers stop sending the header.
- Loading branch information