URL.port

int port() @property const @safe

Return the port from the authority (-1 if absent).

Returns

The port number or -1 if absent.
void port(int value) @property @safe

Set the port in the authority (-1 means absent).

Notes: This setter also marks the inner URI as having an authority so that toString() serializes using the //host form.

Parameters

valuePort number to set; use -1 to clear.