Socket.prototype.remotePort - Node documentation
property Socket.prototype.remotePort

Usage in Deno

import { Socket } from "node:net";

The numeric representation of the remote port. For example, 80 or 21. Value may be undefined if the socket is destroyed (for example, if the client disconnected).

Type

number | undefined