<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLSessionWebSocketTask/CloseCode-swift.enum/mandatoryExtensionMissing",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSURLSessionWebSocketCloseCode@NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing"
  },
  "title" : "URLSessionWebSocketTask.CloseCode.mandatoryExtensionMissing"
}
-->

# URLSessionWebSocketTask.CloseCode.mandatoryExtensionMissing

A code that indicates the client terminated the connection because the server didn’t negotiate a required extension.

```
case mandatoryExtensionMissing
```

## Discussion

RFC 6455 indicates the client should provide a [`closeReason`](/documentation/Foundation/URLSessionWebSocketTask/closeReason) with a list of the needed extensions.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)