<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 12.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWEndpoint/Port",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network10NWEndpointO4PortV"
  },
  "title" : "NWEndpoint.Port"
}
-->

# NWEndpoint.Port

A port number you use along with a host to identify a network endpoint.

```
struct Port
```

## Topics

### Creating Ports

[`init(_:)`](/documentation/Network/NWEndpoint/Port/init(_:))

Initializes a port with a string.

### Setting Well-Known Ports

[`any`](/documentation/Network/NWEndpoint/Port/any)

The unspecified port (port 0).

[`ssh`](/documentation/Network/NWEndpoint/Port/ssh)

The Secure Shell port (port 22).

[`smtp`](/documentation/Network/NWEndpoint/Port/smtp)

The Simple Mail Transfer Protocol port (port 25).

[`http`](/documentation/Network/NWEndpoint/Port/http)

The Hypertext Transfer Protocol port (port 80).

[`pop`](/documentation/Network/NWEndpoint/Port/pop)

The Post Office Protocol port (port 110).

[`imap`](/documentation/Network/NWEndpoint/Port/imap)

The Internet Message Access Protocol port (port 143).

[`https`](/documentation/Network/NWEndpoint/Port/https)

The Secure Hypertext Transfer Protocol port (port 443).

[`imaps`](/documentation/Network/NWEndpoint/Port/imaps)

The Secure Internet Message Access Protocol port (port 993).

[`socks`](/documentation/Network/NWEndpoint/Port/socks)

The SOCKS proxy protocol port (port 1080).

### Comparing Ports

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

[`ExpressibleByIntegerLiteral`](/documentation/Swift/ExpressibleByIntegerLiteral)

[`Equatable`](/documentation/Swift/Equatable)

---

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)