websocket
                                
                                 websocket copied to clipboard
                                
                                    websocket copied to clipboard
                            
                            
                            
                        ws_js: return c.closeErr when closed during read
Return the close error when the WebSocket is closed (when running in WASM).
Previously, when the WebSocket connection is closed by the server, Read always returns net.ErrClosed, which prevents the correct handling of a close error with certain close status codes.
This might not be the best way to fix this, however we have been using this patch in production since June and it appears to resolve the issue and makes it possible to implement logic depending on the close code.