Describe the bug
Websocket extension ignores sub-protocol header in HTML5 build. The Sec-WebSocket-Protocol
gets set to binary
for the HTML5 build no matter what is passed in the params. This causes an inconvenience on Firefox and completely blocks communication on Chrome.
To Reproduce
Build a HTML5 target with Sec-WebSocket-Protocol
being set to anything other than binary
Expected behaviour
The Sec-WebSocket-Protocol
header to be populated with the value passed in the params.
Defold version:
- Defold version: 1.2.174
- Websocket extension version: 1.4.0
Platforms:
- Platforms: HTML5
Minimal repro case project:
Websocket.zip (2.9 KB)
Workaround:
Setting your websocket server to accept the binary
sub-protocol and setting the Sec-WebSocket-Protocol
to binary
for consistency across all build targets allows the game to function and communicate with the server.
Screenshots: