files/en-us/web/api/closeevent/index.md
{{APIRef("Websockets API")}}{{AvailableInWorkers}}
A CloseEvent is sent to clients using {{Glossary("WebSockets")}} when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute.
{{InheritanceDiagram}}
CloseEvent.This interface also inherits properties from its parent, {{domxref("Event")}}.
unsigned short containing the close code.This interface also inherits methods from its parent, {{domxref("Event")}}.
{{Specifications}}
{{Compat}}