<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWProtocolWebSocket",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network19NWProtocolWebSocketC"
  },
  "title" : "NWProtocolWebSocket"
}
-->

# NWProtocolWebSocket

A network protocol for connections that use WebSocket.

```
class NWProtocolWebSocket
```

## Topics

### Creating WebSocket Connections

[`NWProtocolWebSocket.Options`](/documentation/Network/NWProtocolWebSocket/Options)

A container of options for configuring how WebSocket is used on a connection.

[`definition`](/documentation/Network/NWProtocolWebSocket/definition)

The system definition of the WebSocket protocol.

### Handling WebSocket Messages

[`NWProtocolWebSocket.Metadata`](/documentation/Network/NWProtocolWebSocket/Metadata)

A WebSocket message you configure when sending and receiving packets.



---

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)